找不到CreateTataPartition

发布于 2025-01-18 05:58:33 字数 3144 浏览 3 评论 0原文

大家好的一天, 我尝试使用以下代码在R中安装CARET软件包,但是我遇到了一个错误,说明尽管试图安装它,但仍未找到 Stringi ,但我的尝试失败了。

另外,我尝试使用CREATE CreateAtapartition函数对数据进行分区,但是我得到了错误“ **无法找到函数createAtapartition

我使用的代码:

install.packages("caret")

library(caret)

install.packages("stringi")

library(stringi)

结果如下:下面:

**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?*

由于未发现错误,我无法将数据分开:

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"

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"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文