Cant install my packages

Ive been trying to install Tidyr and dplyr however it comes up
Error in install.packages : Updating loaded packages and keeps telling me to restart it as the image below what do I do

I tried uninstalling packages and get this at the beginning and end I have tools installed its still not working

install.packages(c("dplyr", "tidyr"))
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
RTools: Toolchains for building R and R packages from source on Windows
Installing packages into ‘C:/Users/wendy/OneDrive/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependencies ‘fansi’, ‘utf8’, ‘pkgconfig’, ‘withr’, ‘stringi’, ‘cli’, ‘generics’, ‘glue’, ‘lifecycle’, ‘magrittr’, ‘pillar’, ‘R6’, ‘rlang’, ‘tibble’, ‘tidyselect’, ‘vctrs’, ‘purrr’, ‘stringr’, ‘cpp11’

package ‘fansi’ successfully unpacked and MD5 sums checked
Error in install.packages : ERROR: failed to lock directory ‘C:\Users\wendy\OneDrive\Documents\R\win-library\4.0’ for modifying
Try removing ‘C:\Users\wendy\OneDrive\Documents\R\win-library\4.0/00LOCK’

Just say no. I’ve never noticed any difference.

You have a lock file OOLOCK file in the C:\Users\wendy\OneDrive\Documents\R\win-library\4.0 folder that is preventing something being installed. You need to manually delete it.

After that, I'd restart RStudio and try again.

i tried that and got a different error

  • installing source package 'lifecycle' ...
    ** package 'lifecycle' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
    namespace 'rlang' 1.0.2 is being loaded, but >= 1.0.6 is required
    Calls: ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
    Execution halted
    ERROR: lazy loading failed for package 'lifecycle'
  • removing 'C:/Users/wendy/OneDrive/Documents/R/win-library/4.0/lifecycle'
    Warning in install.packages :
    installation of package ‘lifecycle’ had non-zero exit status
    ERROR: dependency 'lifecycle' is not available for package 'pillar'
  • removing 'C:/Users/wendy/OneDrive/Documents/R/win-library/4.0/pillar'
    Warning in install.packages :
    installation of package ‘pillar’ had non-zero exit status
    ERROR: dependency 'lifecycle' is not available for package 'tidyselect'
  • removing 'C:/Users/wendy/OneDrive/Documents/R/win-library/4.0/tidyselect'
    Warning in install.packages :
    installation of package ‘tidyselect’ had non-zero exit status
    ERROR: dependency 'lifecycle' is not available for package 'stringr'
  • removing 'C:/Users/wendy/OneDrive/Documents/R/win-library/4.0/stringr'
    Warning in install.packages :
    installation of package ‘stringr’ had non-zero exit status

Looks like you need to update the {rlang} package.

Restart RStudio then

insall.packages(rlang)

And try again.

Good luck

Error: package or namespace load failed for ‘dplyr’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘lifecycle’
In addition: Warning message:
package ‘dplyr’ was built under R version 4.0.5
i get this instead :((

install.packages("rlang") # missing quote marks

[/quote]

This topic was automatically closed 42 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.