0

I have R 3.2.2 setup installed in my system,with RStudio version 0.99.489. When I tried to install rJava package,

install.packages("rJava")

I am getting following Error:

Warning in install.packages :
downloaded length 4878 != reported length 200
Error in install.packages : subscript out of bounds

But if I run the below command before installing any package,it works fine, but I don't want to do this every time I install a package.

options(repos=structure(c(CRAN="http://cran.us.r-project.org")))
lmo
  • 37,904
  • 9
  • 56
  • 69
Nithin Das
  • 364
  • 1
  • 5
  • 14

1 Answers1

0

You can stick the line you want executed at every startup in your .Rprofile file which should be in your home directory. I have 3.2.3 version of R and that worked; however I do get a warning message about using a non-http version of the site.

Similarly to you, I was finding the original repository the system was using was failing to install the packages--not finding the package or downloading a file with too few bytes, perhaps because of a transient problem. You might want to consider not putting this in your .Rprofile file or commenting the line outin case this is a temporary workaround.