could not find function "createDataPartition"

Error when running

validation_index <- createDataPartition(My_Data$Species, p=0.80, list=FALSE)

Error: could not find function "createDataPartition"

Have you installed and loaded the caret package?

Yes: as below: also "numDeriv" and "lava"

> install.packages("caret")
Installing package into ‘C:/Users/P511366/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/caret_6.0-84.zip'
Content type 'application/zip' length 6223391 bytes (5.9 MB)
downloaded 5.9 MB

package ‘caret’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
	C:\Users\User\AppData\Local\Temp\Rtmp4ELlPy\downloaded_packages

When I run:

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

Oh well, sorry, it had to be asked :grin:

How about Rcpp? The error says you need a version > 1.0.0

1 Like

Ow really, I am installing it now...just a second

Great, you solution worked.

Thanks so much JMCVW

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