0

I would like to install more packages in RStudio and got a error message. Before, I worked with gglot2 and it worked well. When I tried to install other packages, more errors occure.

I loaded library DBI, vctrs without a problem, then I'm trying:

> library(ggplot2)

Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 namespace ‘vctrs’ 0.4.0 is already loaded, but >= 0.5.0 is required

> library(tidyverse)

Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 namespace ‘vctrs’ 0.4.0 is already loaded, but >= 0.4.1 is required

> library(lubridate)

> library(dbplyr)

Error: package or namespace load failed for ‘dbplyr’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 namespace ‘cli’ 3.2.0 is already loaded, but >= 3.3.0 is required

I checked all updates, restart R Studio, tried to update vctrs, but anything works. Could anyone help me?

Phil
  • 7,287
  • 3
  • 36
  • 66
beginner
  • 1
  • 1
  • what happens if you run `install.packages('vctrs')`? – Phil Nov 29 '22 at 19:35
  • @Phil It runs with warning: Warning in install.packages : cannot remove prior installation of package ‘cli’ Warning in install.packages : problem copying C:\R\win-library\4.1\00LOCK\cli\libs\x64\cli.dll to C:\R\win-library\4.1\cli\libs\x64\cli.dll: Permission denied Warning in install.packages : restored ‘cli’ (the rest or error in next post) – beginner Nov 29 '22 at 21:11
  • package ‘vctrs’ successfully unpacked and MD5 sums checked Warning in install.packages : cannot remove prior installation of package ‘vctrs’ Warning in install.packages : problem copying C:\R\win-library\4.1\00LOCK\vctrs\libs\x64\vctrs.dll to C:\R\win-library\4.1\vctrs\libs\x64\vctrs.dll: Permission denied Warning in install.packages : restored ‘vctrs’ – beginner Nov 29 '22 at 21:11

1 Answers1

1

It appears you have old versions of packages installed and loaded.

For example, you have a version of vctrs installed but ggplot2 needs a more recent version. This is especially a problem if you have already called library(vctrs) because the active version of the package is already determined.

The simplest solution is to update your packages. Here are many questions on Stackoverflow about how to do that. Try some of the following links:

Simon.S.A.
  • 6,240
  • 7
  • 22
  • 41