downloaded packages not loading

**For example, ggplot2 isn't loading. **
I've tried

install.packages("ggplot2")
and
install.packages(c("ggplot2"), repos = "https://cran.rstudio.com", dependencies = TRUE)

Installing package into ‘C:/Users/Acrews/OneDrive - SMCMVCD/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/ggplot2_3.3.5.zip'
Content type 'application/zip' length 4129883 bytes (3.9 MB)
downloaded 3.9 MB

package ‘ggplot2’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\Acrews\AppData\Local\Temp\RtmpCSO0bF\downloaded_packages

library("ggplot2")
Error: package or namespace load failed for ‘ggplot2’:
.onLoad failed in loadNamespace() for 'pillar', details:
call: loadNamespace(x)
error: object 'pkgInfo' not found
In addition: Warning message:
In loadNamespace(x) : package ‘crayon’ has no 'package.rds' in Meta/

I'm wondering if there is something wrong with (as ‘lib’ is unspecified).

.libPaths()
[1] "C:/Users/Acrews/OneDrive - SMCMVCD/Documents/R/win-library/4.1"
[2] "C:/Program Files/R/R-4.1.1/library"

Are my downloaded packages going to the wrong location? I went and copied over my downloaded packages into my .libPaths() folder but that didn't solve the issue. I also went to tools>installpackages> install to library
to try and change where the library is going but there aren't any other options in the drop down menu.

I appreciate any help!

I've had stuff like this happen to me too. Try installing pillar and see if that helps.

Welcome @ACrews

Others have reported problems trying to install packages when their
library is located on OneDrive or Dropbox, as either service is trying
to synchronize their contents at the same time as you're installing new
software.

One option is to pause synchronization before trying to install new packages.
The other is to make sure your library as indicated by .libPaths() is located
on a directory that is not being shared or synchronized.

Thank you!
I did have to reassign my default path.
.libPaths()
myPaths <- .libPaths() # get the paths
myPaths <- c(myPaths[2], myPaths[1]) # switch them
.libPaths(myPaths) # reassign them

In order to do this, I had to go to the R studio icon, right click, and run it as an administrator.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.