0

Good evening,

I installed R (version 3.5.1) and I work with RStudio (version 1.1.456) on a 64 bits Windows 7 Home Premium with 4.00 GB (RAM). I downloaded the caret package and I loaded it (library(caret)), but when I attempt to use any of its functions the following messages appear. First, with

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 ‘gtable’
Error: package ‘ggplot2’ could not be loaded
In addition: Warning messages:
1: package ‘caret’ was built under R version 3.5.3 
2: package ‘ggplot2’ was built under R version 3.5.3 

And then, when using any of its functions:

myFolds <- createFolds(y_sd_tr, k = 10)
Error in createFolds(y_sd_tr, k = 10) : 
  could not find function "createFolds"

As a result, I am unable to use caret. Can someone provide some help?

Than you, Marc

DavidPostill
  • 162,382
Marc
  • 11

1 Answers1

1

The warnings are irrelevant here. And usually those warnings about R version are of no consequence. The real problem is:

there is no package called ‘gtable’

Because that is missing ggplot2 refuses to load and because caret requires ggplot2 caret is never loaded.

I wonder what you meant by "downloaded". You should use install.packages to install packages and that should automatically install dependencies unless something went wrong.