R + ggplot:更新geom_tile的问题 [英] R + ggplot: update problems with geom_tile
问题描述
我最近安装了ggplot的最新版本,通过从CRAN下载源代码然后运行
install.packages (/path/to/ggplot2_0.8.8.tar.gz,repos = NULL,type =source)
现在,运行ggplot2网站上geom_tile()的文档中的第一个示例:
$ p $ library(' ggplot2')
pp < - 函数(n,r = 4){
x <-seq(-r * pi,r * pi,len = n)
df < expand.grid(x = x,y = x)
df $ r < - sqrt(df $ x ^ 2 + df $ y ^ 2)
df $ z < - cos(df $ (20),aes(x = x,y = y))$(b ^ 2)* exp(-df $ r / 6)
df
}
p < - ggplot b $ bp + geom_tile(aes(fill = z))
给出以下错误:
get(make_aesthetics,env = x,inherits = TRUE)中的错误(x,...):
可以找不到函数空
任何人有任何想法?
> sessionInfo()
R版本2.10.1修补程序(2010-01-25 r51042)
x86_64-apple-darwin9.8.0
语言环境:
[1] en_GB .UTF-8 / zh_CN.UTF-8 / C / C / en_GB.UTF-8 / en_GB.UTF-8
附加基本软件包:
[1] grid stats graphics grDevices utils数据集方法
[8]基数
其他附加软件包:
[1] ggplot2_0.8.8 proto_0.3-8 reshape_0.8.3 plyr_0.1.9
您还需要更新 plyr
package。
其他附加软件包:
[1] ggplot2_0.8.8 proto_0.3-8 reshape_0.8.3 plyr_1.1
I've recently installed the latest version of ggplot, by downloading the source from CRAN and then running
install.packages("/path/to/ggplot2_0.8.8.tar.gz", repos = NULL, type="source")
Now, running the first example from geom_tile()'s documentation on the ggplot2 website:
library('ggplot2')
pp <- function (n,r=4) {
x <- seq(-r*pi, r*pi, len=n)
df <- expand.grid(x=x, y=x)
df$r <- sqrt(df$x^2 + df$y^2)
df$z <- cos(df$r^2)*exp(-df$r/6)
df
}
p <- ggplot(pp(20), aes(x=x,y=y))
p + geom_tile(aes(fill=z))
gives the following error:
Error in get("make_aesthetics", env = x, inherits = TRUE)(x, ...) :
could not find function "empty"
Anyone got any ideas?
> sessionInfo()
R version 2.10.1 Patched (2010-01-25 r51042)
x86_64-apple-darwin9.8.0
locale:
[1] en_GB.UTF-8/en_GB.UTF-8/C/C/en_GB.UTF-8/en_GB.UTF-8
attached base packages:
[1] grid stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] ggplot2_0.8.8 proto_0.3-8 reshape_0.8.3 plyr_0.1.9
You also need to update the plyr
package.
other attached packages:
[1] ggplot2_0.8.8 proto_0.3-8 reshape_0.8.3 plyr_1.1
这篇关于R + ggplot:更新geom_tile的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!