0

我使用的是 R 版本 2.15.1,但我不小心将 ggplot2 升级到了最新版本。现在我需要回滚到为 2.15.1 构建的 ggplot2 的最后一个版本。我已经从 Hadley 的 github repo 下载了 0.8.9 版,但我似乎无法安装它。运行 install.packages() 静默失败:

> install.packages("~/My Documents/ggplot2-ggplot2-0.8.9.zip", repos=NULL)
> require(ggplot2)
Loading required package: ggplot2
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘ggplot2’

这是使用 Hadley 解决同一问题的另一种方法devtools

> install_version('ggplot2',version='0.8.9', repos='http://cran.us.r-project.org',type='win.binary') 
Installing ggplot2_0.8.9.tar.gz from http://cran.us.r-project.org/src/contrib/Archive/ggplot2/ggplot2_0.8.9.tar.gz
Installing ggplot2
C:/PROGRA~1/R/R-215~1.1/bin/i386/R --vanilla CMD build "C:\Documents and Settings\matthewfrost\Local Settings\Temp\RtmpcP0EzQ\ggplot2" --no-manual --no-resave-data 

* checking for file 'C:\Documents and Settings\matthewfrost\Local Settings\Temp\RtmpcP0EzQ\ggplot2/DESCRIPTION' ... OK
* preparing 'ggplot2':
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* looking to see if a 'data/datalist' file should be added
* building 'ggplot2_0.8.9.tar.gz'
ERROR
packaging into .tar.gz failed
Error: Command failed (1)
In addition: Warning message:
running command '"C:/PROGRA~1/R/R-215~1.1/bin/i386/R" --vanilla CMD build "C:\Documents and Settings\matthewfrost\Local Settings\Temp\RtmpcP0EzQ\ggplot2" --no-manual --no-resave-data'     had status 1 
4

1 回答 1

1

尝试:

install.packages("~/My Documents/ggplot2-ggplot2-0.8.9.zip", lib.loc="~/dev/foo/v1",repos=NULL, type= "source")

library(foo, lib.loc="~/dev/foo/v1") 

@Dirk Eddelbuettel

于 2012-11-07T14:59:36.260 回答