Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install.packages("ggplot2") installing older version (1.0.0)

So I installed an old version of ggplot2 with install_version from devtools (0.9.1 or something) to see how it worked - over the previously installed 2.0.0 version by the way. I then upgraded the version and it surprisingly gave me version 1.0.0, not the current 2.0.0.

Now when I do an install.packages("ggplot2") I get the same 1.0.0. Also selecting "Check for package upgrades.." item from the Rstudio menu it tells me "All packages up to date".

What gives? Isn't the newest version of ggplot now 2.0.0? Here is my session info:

R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] devtools_1.9.1  ggplot2_1.0.0   dplyr_0.4.3     shiny_0.12.2    RevoUtils_7.5.0

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.2      magrittr_1.5     MASS_7.3-43      munsell_0.4.2    colorspace_1.2-6
 [6] xtable_1.8-0     R6_2.1.1         stringr_1.0.0    plyr_1.8.3       tools_3.2.2     
[11] parallel_3.2.2   grid_3.2.2       gtable_0.1.2     DBI_0.3.1        htmltools_0.2.6 
[16] assertthat_0.1   digest_0.6.8     reshape2_1.4.1   memoise_0.2.1    mime_0.4        
[21] stringi_1.0-1    scales_0.3.0     jsonlite_0.9.19  httpuv_1.3.3     proto_0.3-10    
> 

Here are the repositories it is seeing:

> AP <- available.packages() 
> apdf <- data.frame(AP)
> unique(apdf$Repository)
[1] http://mran.revolutionanalytics.com/snapshot/2014-12-01/src/contrib
[2] http://www.stats.ox.ac.uk/pub/RWin/src/contrib                     
2 Levels: http://mran.revolutionanalytics.com/snapshot/2014-12-01/src/contrib ...
> 

Update:

Thanks to Dirk, I see what happened. Looks like installing RRO package reset my CRAN repository. I can also sort of see why that had to be, although maybe I should have got a warning about it. From this blog entry I see how to fix it too. http://www.r-bloggers.com/permanently-setting-the-cran-repository/

like image 887
Mike Wise Avatar asked Oct 19 '22 18:10

Mike Wise


1 Answers

Run

 AP <- available.packages()     # possibly with repo options

and examine the result set.

That is what your R session knows about packages, and it is a function of

  • the R version; you generally want the newest series (and you have 3.2.*)
  • the repos you select (which you did not show)

Edit: I typically use options("repos") to check which repositories I have, and I tend to control that from Rprofile.site. But you seem to have RevoR and I do not know how/if that interacts.

like image 55
Dirk Eddelbuettel Avatar answered Oct 22 '22 18:10

Dirk Eddelbuettel