Can not find function "createDataPartition"

Hi, I'm trying to calculate de AUCroc of a logistic regression model I've created and for that need the function "createDataPartition" of the package caret.
I've installed the package caret, as well as the "glue", the "gluedown", and the "rcpp" since the error says that I need a version > 1.0.
> library(caret)
Loading required package: lattice
Loading required package: ggplot2
Error: package or namespace load failed for ‘caret’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
namespace ‘glue’ 1.3.1 is already loaded, but >= 1.3.2 is required

But when I run it:
set.seed(123)
trainIndex=createDataPartition(TFMrl$beta, p=0.70)$Resample1

I get this message:

Error in createDataPartition(TFMrl$beta, p = 0.7) : 
  could not find function "createDataPartition"

Does anyone know how to solve it?
Thank you so much!

you should

install.packages("glue")

Yes, I've already tried to install this package. At first it won't work if I try to restart R session. If I dont' restart it, it gives me this message:

install.packages("glue")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/Usuario/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/glue_1.4.2.zip'
Content type 'application/zip' length 154669 bytes (151 KB)
downloaded 151 KB

package ‘glue’ successfully unpacked and MD5 sums checked
Warning in install.packages : cannot remove prior installation of package ‘glue’
Warning in install.packages :
problem copying C:\Users\Usuario\Documents\R\win-library\3.6\00LOCK\glue\libs\x64\glue.dll to C:\Users\Usuario\Documents\R\win-library\3.6\glue\libs\x64\glue.dll: Permission denied
Warning in install.packages :
restored ‘glue’

Do you know how to remove prior installation of package ‘glue’?
Thank you!

I think its as simple as restarting Rstudio so that packages arent loaded. Ctrl = Shift F10 (and not having workspace autoloading). Then you could install glue.

Thank you so much @nirgrahamuk !

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.