Dear the R Community, I just encountered an error while using ggplot2 and the qplot function (please see below for the warnings and error), and i have no idea about how to make changes so that it will work. Could anyone kindly advise me a bit and help me out here? ------------------------------------------------------------------------------------------------------> library(ggplot2)Warning message: package ?ggplot2? was built under R version 3.2.5> library(ggplot2) > dodge <- position_dodge(width = .9) > plot <- qplot(happening, target.looking_M, data=d.c2.subjects,stat="identity", + geom="bar", position=dodge, + ylab="Proportion of looks", xlab="happening", + fill=happening, colour=happening, + main="Proportion target looking by condition and testing phase for each single subject") Warning messages: 1: `stat` is deprecated 2: `position` is deprecated> plot <- plot + facet_grid(type ~ subjectname) > plotError: stat_count() must not be used with a y aesthetic. ------------------------------------------------------------------------------------------------------- thank you very much. Cheers, Daniel [[alternative HTML version deleted]]
I do not use ggplot2 myself but I think my first action would be to update you version of ggplot2 and possibly also of R. On 05/12/2016 10:28, Daniel wrote:> Dear the R Community, > > I just encountered an error while using ggplot2 and the qplot function > (please see below for the warnings and error), and i have no idea about how > to make changes so that it will work. > Could anyone kindly advise me a bit and help me out here? > > ------------------------------------------------------------------------------------------------------ >> library(ggplot2) > Warning message: > package ?ggplot2? was built under R version 3.2.5 > >> library(ggplot2) >> dodge <- position_dodge(width = .9) >> plot <- qplot(happening, target.looking_M, data=d.c2.subjects, > stat="identity", > + geom="bar", position=dodge, > + ylab="Proportion of looks", xlab="happening", > + fill=happening, colour=happening, > + main="Proportion target looking by condition and testing phase for each > single subject") > > Warning messages: > 1: `stat` is deprecated > 2: `position` is deprecated > >> plot <- plot + facet_grid(type ~ subjectname) >> plot > > Error: stat_count() must not be used with a y aesthetic. > ------------------------------------------------------------------------------------------------------- > > thank you very much. > > Cheers, > Daniel > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Michael http://www.dewey.myzen.co.uk/home.html
Given the error messages, it looks like the OP may already have updated and needs to update their code to match. Perhaps reading ?qplot or learning how to use the ggplot function instead of qplot should be next steps. -- Sent from my phone. Please excuse my brevity. On December 5, 2016 8:05:36 AM PST, Michael Dewey <lists at dewey.myzen.co.uk> wrote:>I do not use ggplot2 myself but I think my first action would be to >update you version of ggplot2 and possibly also of R. > >On 05/12/2016 10:28, Daniel wrote: >> Dear the R Community, >> >> I just encountered an error while using ggplot2 and the qplot >function >> (please see below for the warnings and error), and i have no idea >about how >> to make changes so that it will work. >> Could anyone kindly advise me a bit and help me out here? >> >> >------------------------------------------------------------------------------------------------------ >>> library(ggplot2) >> Warning message: >> package ?ggplot2? was built under R version 3.2.5 >> >>> library(ggplot2) >>> dodge <- position_dodge(width = .9) >>> plot <- qplot(happening, target.looking_M, data=d.c2.subjects, >> stat="identity", >> + geom="bar", position=dodge, >> + ylab="Proportion of looks", xlab="happening", >> + fill=happening, colour=happening, >> + main="Proportion target looking by condition and testing phase for >each >> single subject") >> >> Warning messages: >> 1: `stat` is deprecated >> 2: `position` is deprecated >> >>> plot <- plot + facet_grid(type ~ subjectname) >>> plot >> >> Error: stat_count() must not be used with a y aesthetic. >> >------------------------------------------------------------------------------------------------------- >> >> thank you very much. >> >> Cheers, >> Daniel >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> > >-- >Michael >http://www.dewey.myzen.co.uk/home.html > >______________________________________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide >http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.