Package "XXX" is not installed for 'arch = x64'

Hello, I am having trouble using the library function after using the install. packages function for dplyr and I believe the problem is with R (not studio).

The problem also persists if I try to use the 32-bit version of R in R studio and I have tried downloading R/RStudio, using older versions etc. Codes below ->

Any advice is massively appreciated!! Massive beginner with R so any advice in laymans terms is even more appreciated, apologies

install.packages("dplyr")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/ronan.conlon/OneDrive - Frontiers Media SA/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/dplyr_1.0.7.zip'
Content type 'application/zip' length 1344315 bytes (1.3 MB)
downloaded 1.3 MB

package ‘dplyr’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot delete reparse point 'C:\Users\ronan.conlon\OneDrive - Frontiers Media SA\Documents\R\win-library\4.1/dplyr/libs', reason 'There is a mismatch between the tag specified in the request and the tag present in the reparse point'
Warning in install.packages :
cannot remove prior installation of package ‘dplyr’
Warning in install.packages :
cannot delete reparse point 'C:\Users\ronan.conlon\OneDrive - Frontiers Media SA\Documents\R\win-library\4.1/dplyr/libs', reason 'There is a mismatch between the tag specified in the request and the tag present in the reparse point'
Warning in install.packages :
restored ‘dplyr’

The downloaded binary packages are in
C:\Users\ronan.conlon\AppData\Local\Temp\RtmpYRTNDq\downloaded_packages

library(dplyr)
Error: package ‘dplyr’ is not installed for 'arch = x64'

This same problem arises with trying to install/library tidyverse;

library(tidyverse)
-- Attaching packages -------------------------------------------------------------------------------- tidyverse 1.3.1 --
v ggplot2 3.3.5 v purrr 0.3.4
v tibble 3.1.5 v dplyr 1.0.7
v tidyr 1.1.4 v stringr 1.4.0
v readr 2.0.2 v forcats 0.5.1
Error: package or namespace load failed for ‘tidyverse’:
.onAttach failed in attachNamespace() for 'tidyverse', details:
call: NULL
error: package ‘dplyr’ is not installed for 'arch = x64'

R has problems with cloud synced folders, I would recommend setting your package library in a non synced folder.

You can change the default library folder by setting your R_LIBS_SITE environmental variable in a .Reviron or .Rprofile file. For example:

# In a .Renviron file you can set it by adding a line like this one with the desired location 
R_LIBS_SITE="C:\\Program Files\\R\\R-4.1.2\\library"

For a more detailed explanation, you can read this blog post

1 Like