【问题标题】:R + ggplot: update problems with geom_tileR + ggplot:geom_tile 的更新问题
【发布时间】:2010-08-19 13:58:38
【问题描述】:

我最近安装了最新版本的 ggplot,通过从 CRAN 下载源代码然后运行

install.packages("/path/to/ggplot2_0.8.8.tar.gz", repos = NULL, type="source")

现在,运行 ggplot2 网站上 geom_tile() 文档中的第一个示例:

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))

给出以下错误:

Error in get("make_aesthetics", env = x, inherits = TRUE)(x, ...) : 
  could not find function "empty"

有人有什么想法吗?

> 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

【问题讨论】:

    标签: r ggplot2


    【解决方案1】:

    您还需要更新plyr 包。

    other attached packages:
    [1] ggplot2_0.8.8  proto_0.3-8    reshape_0.8.3  plyr_1.1   
    

    【讨论】:

    • 太棒了。有什么方法可以让我自己发现吗?
    • 好吧,您可以使用dependencies = TRUE 选项运行install.packages()...
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-09
    • 2016-11-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多