0

How can I install a package from a zip file in R? I'm using the tools > install packages then selecting the install from 'Package Archive File (.zip, .tar.gz)' option. However an error message occurs. I have devtools installed, so the console window looks like this:

library("devtools", lib.loc="~/R/win-library/3.2")
install.packages("C:/Users/noodl/Downloads/RPUX/rpux_0.5.1/rpud_0.5.1.zip", repos = NULL)
Installing package into ‘C:/Users/noodl/Documents/R/win-library/3.2’ (as ‘lib’ is unspecified)

Error in install.packages : type == "both" cannot be used with 'repos = NULL'

I'm using R version 3.2

smci
  • 32,567
  • 20
  • 113
  • 146
user27612
  • 55
  • 1
  • 7
  • Duplicate of the (admittedly badly-named) ["Error in install.packages : type ==“both” cannot be used with 'repos =NULL'"](http://stackoverflow.com/questions/30123786/error-in-install-packages-type-both-cannot-be-used-with-repos-null) – smci Mar 13 '17 at 03:44

1 Answers1

2

This is a common question ... so common, in fact, I didn't immediately find a SO question that was actually answered in an answer vice a comment. The most recent I found was @DirkEddelbuettel's comment here: add type="binary" to your command.

Community
  • 1
  • 1
r2evans
  • 141,215
  • 6
  • 77
  • 149
  • Right, but the naming of ["Error in install.packages : type ==“both” cannot be used with 'repos =NULL'"](http://stackoverflow.com/questions/30123786/error-in-install-packages-type-both-cannot-be-used-with-repos-null) is poor and the naming of this question is very clear. – smci Mar 13 '17 at 03:46