0

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 
MW Frost
  • 980
  • 1
  • 11
  • 23

1 Answers1

1

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

Community
  • 1
  • 1
metasequoia
  • 7,014
  • 5
  • 41
  • 54
  • Thanks for adding the `source` argument. It got me a little farther, since the build is no longer failing, so I'll upvote it. But I still can't load the resulting folder as a library. There's a directory called `ggplot2-ggplot2-0.8.9` in the library folder, but R won't recognize either `ggplot2` or `ggplot2-ggplot2-0.8.9` as a valid installed package. – MW Frost Nov 07 '12 at 15:09
  • Have you removed the version that you don't want? `remove.packages(pkgs, lib, version)` – metasequoia Nov 07 '12 at 15:30
  • Yes, and the installation still fails. – MW Frost Nov 07 '12 at 15:33
  • Thanks, but the `library()` command won't recognize either `'ggplot2'` or `'ggplot2-ggplot2-0.8.9'` as packages, even when I specify the `lib.loc` argument. – MW Frost Nov 07 '12 at 16:00