tag:blogger.com,1999:blog-6232819486261696035.post2900107521482846334..comments2023-09-25T09:01:44.323-05:00Comments on Getting Genetics Done: Install and load R package "Rcmdr" to quickly install lots of other packagesStephen Turnerhttp://www.blogger.com/profile/06656711316726116187noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-6232819486261696035.post-31310179614366293262010-09-22T03:54:32.755-05:002010-09-22T03:54:32.755-05:00On the new system you can load the package list us...On the new system you can load the package list using read.table or scan:<br /><br />packages <- scan("Rpackages.txt", "character")<br /><br />Then, to avoid reinstalling packages that are already there, I would use<br /><br />install.packages(packages[!(packages %in% installed.packages())], dependencies=T)<br /><br />to get all the missing packages in place.Roberthttps://www.blogger.com/profile/04936302238915850328noreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-87993613883756858282010-09-21T21:15:16.550-05:002010-09-21T21:15:16.550-05:00I find Robert's solution in principle easier b...I find Robert's solution in principle easier but since I'm just beginning to learn my way with R, may I know how would you pass "Rpackages.txt" as a character vector to the install.packages function?<br />Many thanks in advance,<br />RubenUnknownhttps://www.blogger.com/profile/15941626009785391532noreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-68154073436483212822010-09-21T21:12:13.920-05:002010-09-21T21:12:13.920-05:00If you use OS X you could refer to:
http://onertip...If you use OS X you could refer to:<br />http://onertipaday.blogspot.com/2008/10/r-upgrade-on-mac-os-x-1055-leopard.htmlUnknownhttps://www.blogger.com/profile/15941626009785391532noreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-49844672251826005712010-09-21T10:36:03.931-05:002010-09-21T10:36:03.931-05:00I have a R-script called "maintenance.R"...I have a R-script called "maintenance.R" which I've used to originally install the packages, e.g:<br /><br /># Install Bioconductor<br />source("http://bioconductor.org/biocLite.R")<br />biocLite()<br /><br /># Install Bioconductor packages<br />source("http://bioconductor.org/biocLite.R")<br />biocLite("affyQCReport")<br />biocLite("latticeExtra")<br />...<br /><br /># Install R-packages<br />install.packages("gap")<br />install.packages("matlab")<br />install.packages("lattice")<br /><br />And then I have also commands for updating all installed packages, e.g.:<br /><br />#Update R packages<br />update.packages(ask=FALSE)<br /><br /># Update installed Bioconductor packages<br />source("http://bioconductor.org/biocLite.R")<br />update.packages(repos=biocinstallRepos(), ask=FALSE)<br /><br />..For me this is very easy way to install and update all the packages, and if I need to set up a new machine, new install of R or whatever, it is really simple to just run that script.jnoreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-18169395380424966162010-09-21T10:26:30.715-05:002010-09-21T10:26:30.715-05:00If the old system is still available you can use
...If the old system is still available you can use<br /><br />installed.packages()[,1]<br /><br />to get a list of all installed packages. Save it somewhere:<br /><br />write.table(installed.packages()[,1], row.names=F, col.names=F, file="Rpackages.txt")<br /><br />and pass it as a character vector to install.packages() on the new system to get the same setup.Roberthttps://www.blogger.com/profile/04936302238915850328noreply@blogger.com