I am trying to install zipped binary R packages via command line on a windows 7 machine with
R CMD INSTALL packagename
but it doesn’t work. I read that CMD INSTALL can’t be used to install binary packages. So how can I install binary packages via command line?
You can use the
Rscriptfront end to run code as if it were in a running R session. Say the package you want to install isfoo.zipin the current working directory. I’m probably abusingRscripthere, but it works for me:You need to supply the path to the binary package if it is not in the directory where there script is running.
repos = NULLis the trick to getinstall.packages()to work from a local file. Read?install.packagesfor more info on other arguments you might want to specify, especiallylib. Note that you don’t benefit from automatic dependency resolution when doing this – you need arepofor that and if you supply one, R will try to download packages.You are right about
R CMD INSTALL; the R Installation and Administration manual has the following in Section 6.3: