Good day everyone, I tried installing the caret package in R with the following codes but I am having an error stating that Stringi is not found despite trying to install that, I got a failed attempt.
Also, I tried to partition my data using the create createDataPartition
function but I got the error "**could not find function createDataPartition
The codes I used:
install.packages("caret")
library(caret)
install.packages("stringi")
library(stringi)
The results are below:
**install.packages("caret")**
*Installing package into ‘C:/Users/Anuli/OneDrive - The University of Texas-Rio Grande Valley/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘CARET’ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
Warning in install.packages :
Perhaps you meant ‘caret’ ?*
**library(caret)**
*Loading required package: ggplot2
Loading required package: lattice
Error: package or namespace load failed for ‘caret’ in library.dynam(lib, package, package.lib):
DLL ‘stringi’ not found: maybe not installed for this architecture?*
**install.packages("stringi")**
*Installing package into ‘C:/Users/Anuli/OneDrive - The University of Texas-Rio Grande Valley/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/stringi_1.7.6.zip'
Content type 'application/zip' length 16449819 bytes (15.7 MB)
downloaded 15.7 MB
package ‘stringi’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot delete reparse point 'C:\Users\Anuli\OneDrive - The University of Texas-Rio Grande Valley\Documents\R\win-library\4.1/stringi/libs/x64', reason 'There is a mismatch between the tag specified in the request and the tag present in the reparse point'
Warning in install.packages :
cannot remove prior installation of package ‘stringi’
Warning in install.packages :
cannot delete reparse point 'C:\Users\Anuli\OneDrive - The University of Texas-Rio Grande Valley\Documents\R\win-library\4.1/stringi/libs/x64', reason 'There is a mismatch between the tag specified in the request and the tag present in the reparse point'
Warning in install.packages :
restored ‘stringi’
The downloaded binary packages are in
C:\Users\Anuli\AppData\Local\Temp\RtmpyqAGs4\downloaded_packages*
**library(stringi)**
*Error: package or namespace load failed for ‘stringi’ in library.dynam(lib, package, package.lib):
DLL ‘stringi’ not found: maybe not installed for this architecture?*
As a result of the stringi not found error, I am unable to split my data:
myData$cyl <- as.factor(myData$cyl)
sapply(myData, is.factor)
mpg cyl disp hp drat wt qsec vs am gear carb
FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
set.seed(1)
index <- createDataPartition(myData$cyl, p=0.75, list=FALSE)
Error in createDataPartition(myData$cyl, p = 0.75, list = FALSE) :
could not find function "createDataPartition"