MW Frost
MW Frost

Reputation: 990

Installing ggplot2 from local zip isn't happening

I'm using R version 2.15.1, but I accidentally upgraded ggplot2 to the latest version. Now I need to roll back to the last version of ggplot2 that was built for 2.15.1. I've downloaded version 0.8.9 from Hadley's github repo, but I can't seem to install it. Running install.packages() fails silently:

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

Here's another approach to the same problem, using Hadley's 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 

Upvotes: 0

Views: 1082

Answers (1)

metasequoia
metasequoia

Reputation: 7274

try:

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

See @Dirk Eddelbuettel

Upvotes: 1

Related Questions