简体   繁体   English

如何从zip安装R软件包?

[英]How do I install an R package from zip?

I have read a bunch of questions and sites about installing an R package from a zip, but I cannot get it to work properly. 我已经阅读了许多有关从zip安装R软件包的问题和站点,但是我无法使其正常工作。 I am running the command: 我正在运行命令:

install.packages("caret_6.0-24.zip", dependencies = c("Depends", "Suggests"))

It looks like it works, it gives me this repsonse: 看起来可行,它给了我这个答复:

inferring 'repos = NULL' from the file name
package ‘caret’ successfully unpacked and MD5 sums checked

The problem is that after I've installed the package, it doesn't seem to do anything. 问题是在我安装了软件包之后,它似乎什么也没做。 For example, I run this command and get the response on the second line. 例如,我运行此命令并在第二行得到响应。

inTrain <- createDataPartition(y = data$class, p = .75, list = FALSE)
Error: could not find function "createDataPartition"

Any ideas or suggestions? 有什么想法或建议吗?

Have you used require or library to load the package? 您是否使用requirelibrary来加载软件包? Installing just downloads and places the files in a specific directory that can be later loaded from. 安装仅会下载文件并将文件放在特定目录中,以便以后从中加载。 Try: 尝试:

library(caret)

Or 要么

require(caret)  

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM