0

I have downloaded the caret package to my local working directory:

install.packages("caret")

However when I try to load the library I get the following error:

library(caret)

>Loading required package: ggplot2  Error: package or namespace load failed for ‘ggplot2’ in
> loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): 
> there is no package called ‘rlang’ Error: package ‘ggplot2’ could not
> be loaded

I can see ggplot2 in my library:

lapply(.libPaths(),dir)
[[1]]....    "ggplot2"  ....

I am using R ver 3.6.2 for Mac OS X on OS Mojave 10.14.4 I haven't encountered this using R in windows, so any input appreciated .

StupidWolf
  • 45,075
  • 17
  • 40
  • 72
dancingbush
  • 2,131
  • 5
  • 30
  • 66
  • 7
    What happens if you `install.packages("rlang")`? – r2evans Mar 09 '20 at 20:02
  • yes that worked, I never noted this issue using R in windows, I wonder is it related to Mac X version only? – dancingbush Mar 09 '20 at 21:01
  • 2
    Nope, that package (and that error) is common to every platform. I can only imagine that at some point you installed something that included `rlang` in its dependency list, so it was installed for you. – r2evans Mar 09 '20 at 21:59
  • Do you want to post as the answer so I can accept it, cheers – dancingbush Mar 12 '20 at 07:28
  • Thanks, but this is not an uncommon question. Without spending too much time researching, my guess is that this is addressed in one or more from https://stackoverflow.com/q/25721884/3358272. I'm glad it worked for you! – r2evans Mar 12 '20 at 14:41
  • No problem thanks again – dancingbush Mar 12 '20 at 17:43

0 Answers0