2

I'm trying to install Tidytext package. It seems to me that R is installing the package into my OneDrive. I've been using R and I've not run into this problem before. I've unsynchronized One Drive and done a variety of things to change my working drive, but I still get the following message when installing Tidytext package -

Installing package into "C:/Users/Anjan/OneDrive/Documents/R/win-library/3.5" (as "lib" is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/tidytext_0.2.0.zip' Content type 'application/zip' length 2836849 bytes (2.7 MB) downloaded 2.7 MB

I've unsynchronized One Drive from my Documents folder on This PC. I've checked getwd() I've set setwd() I've used Tools and Global Options and changed my working directory.

But R still uses One Drive. How do I get R to not use One Drive?

install.packages("tidytext") Installing package into "C:/Users/Anjan/OneDrive/Documents/R/win-library/3.5" (as "lib" is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/tidytext_0.2.0.zip' Content type 'application/zip' length 2836849 bytes (2.7 MB) downloaded 2.7 MB

package ‘tidytext’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in C:\Users\Anjan\AppData\Local\Temp\RtmpYDylTE\downloaded_packagesinstall.packages("magritte") Installing package into "C:/Users/Anjan/OneDrive/Documents/R/win-library/3.5" (as "lib"is unspecified) Warning in install.packages : package ‘magritte’ is not available (for R version 3.5.3) getwd() [1] "C:/Users/Anjan/OneDrive/Documents"

Ken White
  • 123,280
  • 14
  • 225
  • 444
user11386282
  • 21
  • 1
  • 2
  • 2
    Possible duplicate of [Change R default library path using .libPaths in Rprofile.site fails to work](https://stackoverflow.com/questions/15170399/change-r-default-library-path-using-libpaths-in-rprofile-site-fails-to-work) – NelsonGon Apr 28 '19 at 05:35

2 Answers2

0

Use this to see actual library paths:

.libPaths()

And the same to set another destination folder to install:

.libPaths(PATH_THAT_YOU_WANT)

You can also specify a location like we see here:

Install R package to a specific directory

Take a look into the docs:

https://rdocumentation.org/packages/base/versions/3.6.1/topics/libPaths

0

It's a bug, reported at https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17842.

R should never put libraries in a user's documents folder. That is an inappropriate use of that folder, and there are better places for this kind of data.

Aren Cambre
  • 6,540
  • 9
  • 30
  • 36