ggplot2 version 0.9.3 is giving me an error

2,162 views
Skip to first unread message

Mike Dylan

unread,
Dec 7, 2012, 5:01:41 PM12/7/12
to ggp...@googlegroups.com
I just installed ggplot2 verstion 0.9.3 and giving me this error. Any ideas what might be wrong? Anybody seen this yet?
 
Error in rename(x, .base_to_ggplot, warn_missing = FALSE) :
  could not find function "revalue"

Mike Dylan

unread,
Dec 7, 2012, 5:35:29 PM12/7/12
to ggp...@googlegroups.com
I found what the problem was. I had to update plyr as well. I am not getting any error but when I do this: ggplot(mtcars, aes(wt, mpg)) + geom_bar(stat = "identity")
 
I get a blank graph, not data points. Any ideas?

Steve Walker

unread,
Dec 7, 2012, 5:45:29 PM12/7/12
to ggp...@googlegroups.com
Hi Mike,

This may or may not be helpful, but the command you posted about generates a plot with bars for me (i.e. not nothing as you experienced).  However, I do get the following warning message:

Warning message:
position_stack requires constant width: output may be incorrect

My session info is below.  Maybe you still need to update some packages???

Cheers,
Steve.

> sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base    

other attached packages:
[1] ggplot2_0.9.3

loaded via a namespace (and not attached):
 [1] colorspace_1.2-0   dichromat_1.2-4    digest_0.6.0       grid_2.15.2      
 [5] gtable_0.1.1       labeling_0.1       MASS_7.3-22        munsell_0.4      
 [9] plyr_1.8           proto_0.3-9.2      RColorBrewer_1.0-5 Rcpp_0.10.1      
[13] reshape2_1.2.1     scales_0.2.3       stringr_0.6.1      tools_2.15.2 
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
 
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2

Dennis Murphy

unread,
Dec 7, 2012, 8:28:23 PM12/7/12
to Steve Walker, Mike Dylan, ggp...@googlegroups.com
Hi:

As found in several posts on this group today, you need to reinstall
ggplot2 and plyr in a fresh R session, and it's probably safer to do
the same with scales and gtable:

install.packages(c("plyr", "ggplot2", "scales", "gtable"))

On Fri, Dec 7, 2012 at 2:45 PM, Steve Walker <steve....@utoronto.ca> wrote:
> Hi Mike,
>
> This may or may not be helpful, but the command you posted about generates a
> plot with bars for me (i.e. not nothing as you experienced). However, I do
> get the following warning message:
>
> Warning message:
> position_stack requires constant width: output may be incorrect

If you add geom_point() to this graph, you'll discover that there are
two values of wt that have replicate mpg values, and that's the source
of the warning (e.g., at the point of the maximum spike).

Dennis

Winston Chang

unread,
Dec 10, 2012, 11:28:51 AM12/10/12
to hskr, ggplot2
It looks like this is bug, which I've filed here:
  https://github.com/hadley/ggplot2/issues/739

It was introduced in the process of fixing another bug. :(

-Winston


On Sun, Dec 9, 2012 at 12:40 PM, hskr <hsk...@gmail.com> wrote:

After updating to ggplot2_0.9.3, previous code used to make summary plots (using stat_summary) no longer work. I get the error message "Each group consist of only one observation. Do you need to adjust the group aesthetic?". My data has more than one observation for each group.  

I've tried to recreate the error using the mtcars data.


Any suggestions on how to properly create these summary plots would be greatly appreciated.

 

p <- ggplot(mtcars, aes(cyl,hpcolour = factor(gear))) 

<- p + geom_point()

p <- p + stat_summary(aes(group = factor(gear)), fun.y = meangeom "line")

p


# geom_path: Each group consist of only one observation. Do you need to adjust the group aesthetic?



# sessionInfo()

# R version 2.15.2 (2012-10-26)

# Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)


# locale:

# [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8


# attached base packages:

# [1] stats     graphics  grDevices utils     datasets  methods   base     


# other attached packages:

# [1] reshape2_1.2.2 plyr_1.8       ggplot2_0.9.3  knitr_0.9     


# loaded via a namespace (and not attached):

 # [1] colorspace_1.2-0   dichromat_1.2-4    digest_0.6.0       evaluate_0.4.3    

 # [5] formatR_0.7        grid_2.15.2        gtable_0.1.2       labeling_0.1      

 # [9] MASS_7.3-22        munsell_0.4        proto_0.3-9.2      RColorBrewer_1.0-5

# [13] scales_0.2.3       stringr_0.6.2      tools_2.15.2    

Winston Chang

unread,
Dec 10, 2012, 11:32:16 AM12/10/12
to hskr, ggplot2
As a workaround, I'd suggest summarizing the data by hand using ddply:

library(plyr)
mtcars_m <- ddply(mtcars, c("cyl", "gear"), summarise, hp = mean(hp))

ggplot(mtcars, aes(cyl,hp, colour = factor(gear))) +
    geom_point() +
    geom_line(data=mtcars_m)


-Winston

Sean

unread,
Dec 31, 2012, 10:50:05 PM12/31/12
to Shengwu Shang, ggp...@googlegroups.com, Steve Walker
Try it with the versions.

Sent from my iPhone

On Dec 31, 2012, at 9:11 PM, Shengwu Shang <shws...@gmail.com> wrote:

When I implement "install.packages(c("plyr", "ggplot2", "scales", "gtable")) ", I get this error message:

Error in library(plyr) : there is no package called ‘plyr’

Any thoughts about that?

Thanks!

Winston Chang

unread,
Jan 1, 2013, 2:28:14 PM1/1/13
to Shengwu Shang, ggplot2, Steve Walker, Mike Dylan
Are you running this with a clean R session, without any packages loaded? If you include your sessionInfo, that would help to diagnose the problem.

-Winston


On Mon, Dec 31, 2012 at 8:11 PM, Shengwu Shang <shws...@gmail.com> wrote:
When I implement "install.packages(c("plyr", "ggplot2", "scales", "gtable")) ", I get this error message:

Error in library(plyr) : there is no package called ‘plyr’

Any thoughts about that?

Thanks!


On Friday, December 7, 2012 7:28:23 PM UTC-6, Dennis Murphy wrote:
Reply all
Reply to author
Forward
0 new messages