2013-07-09 40 views
0

错误消息我有一个数据帧以下的那种“DF1”:GGPLOT2:我无法理解

set.seed(2) 
df1 = data.frame(Var1=rep(c('a','b','c','d'),3), 
       Var2=rep(c('aa','bb','cc'),each=4), 
       value=rnorm(12)) 

我尝试创建该地块:

ggplot(df1) + geom_bar(aes(x=Var2,y=value),stat="identity") + facet_wrap(~Var1) 

和我以下错误信息我不明白:

formal classes cannot be used without the methods package 

怎么了?顺便说一句,我找不到一个叫方法的包。

这里是我的sessionInfo()

R version 3.0.1 (2013-05-16) 
Platform: x86_64-apple-darwin10.8.0 (64-bit) 

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

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

other attached packages: 
[1] agricolae_1.1-4 reshape2_1.2.2 lattice_0.20-15 ggplot2_0.9.3.1 data.table_1.8.8 

loaded via a namespace (and not attached): 
[1] colorspace_1.2-2 datasets_3.0.1  dichromat_2.0-0 digest_0.6.3  grDevices_3.0.1 grid_3.0.1   gtable_0.1.2  
[8] labeling_0.1  lme4_0.999999-2 MASS_7.3-26  Matrix_1.0-12  munsell_0.4  nlme_3.1-109  plyr_1.8   
[15] proto_0.3-10  RColorBrewer_1.0-5 scales_0.2.3  stats4_3.0.1  stringr_0.6.2  tools_3.0.1 

谢谢

+0

你能提供你的'sessionInfo()'吗?我没有在Ubuntu 12.04上使用'R' 3.0.1和'ggplot2' 0.9.3.1得到这个错误。 – Justin

+0

适用于我,R 3.0.1,ggplot 0.9.3.1和W7。 –

+1

噢,问题解决了!我重新启动R!感谢你们 ! –

回答

0

尝试重新启动您的R对话!