我正在使用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
答案 0 :(得分: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")