2

I can't seem to get downloaded packages into the right place so that they work. I open the RGui as administrator and type:

install.packages("ggplot2", lib="C:/Program Files/R/R-3.2.2/library")

it returns:

The downloaded binary packages are in
C:\...path...Temp\RtmpcLuCYn\downloaded_packages

which is not the place it should have gone to which is the first problem. So I try to load the package from this location:

library(ggplot2, lib.loc="C:/...path...Temp/RtmpcLuCYn/downloaded_packages")

and it returns:

Error in library(ggplot2, lib.loc = "C:/...path...Temp/RtmpcLuCYn/downloaded_packages") :

there is no package called ‘ggplot2’

so I figure let's try just loading from where I told it to put the file:

library(ggplot2, lib.loc="C:/Program Files/R/R-3.2.2/library")

unsurprisingly this didn't work, it returned:

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘Rcpp’
Error: package or namespace load failed for ‘ggplot2’

I have no idea why it sends the download to a temp location but it seems reasonable that this is the cause of the problem. I have administrator access. I have also tried:

adding "C:/Program Files/R/R-3.2.2/library" as an environment variable

adding R_LIBS_USER to user variables with the value 'C:/Program Files/R/R-3.2.2/library'

just downloading with the command:

install.packages('ggplot2')

the errors and returns are identical

Any further advice would be much appreciated.

G5W
  • 36,531
  • 10
  • 47
  • 80
user3062260
  • 1,584
  • 4
  • 25
  • 53
  • try `install.packages("ggplot2",dependencies=TRUE)` ? – Ben Bolker Nov 03 '15 at 21:28
  • i.e.. possible duplicate: http://stackoverflow.com/questions/31717850/error-package-or-namespace-load-failed-for-ggplot2-and-for-data-table – Ben Bolker Nov 03 '15 at 21:33
  • I tried install.packages("ggplot2",dependencies=TRUE) but the same problem persists, i.e. it is downloaded to a temp location. This is not a duplicate question: This question relates to the download being installed to a temp folder from which the package can't be retrieved. It downloads here despite being instructed to download to the R-libraries folder. The solutions in the link you have posted don't work for this problem. Thanks for your effort though – user3062260 Nov 03 '15 at 22:34
  • 2
    The sourcecode or binary is _downloaded_ into the temp location. But it is _installed_ into `lib.loc`. Try in a fresh session first `install.packages("ggplot2",dependencies=TRUE)`, then `library(ggplot2)`. – Thierry Nov 03 '15 at 23:08
  • This doesn't work either, it still says "Error: package or namespace load failed for ‘ggplot2’". I get the feeling that the download needs to go to the right place and it isn't even though I am telling it where it should download to. – user3062260 Nov 04 '15 at 07:08

0 Answers0