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!