如何在ShareLatex knitr文件(.Rtex)中安装软件包? R代码
par(mfrow=c(1,1))
install.packages("tree")
library(tree)
model.tree.simpel <- tree(response~.,data=dat)
plot(model.tree.simpel)
text(model.tree.simpel)
错误消息
Installing package into '/usr/local/lib/R/site-library'## (as 'lib' is unspecified)##
Warning in install.packages("tree"):
'lib = "/usr/local/lib/R/site-library"' is notwritable##
Error in install.packages("tree"): unable to install packages##
Error in library(tree): there is no package called 'tree'##
Error in eval(expr, envir, enclos): could not find function "tree"##
Error in plot(model.tree.simpel): object 'model.tree.simpel' not found##
Error in text(model.tree.simpel): object 'model.tree.simpel' not found
答案 0 :(得分:0)
您似乎无法安装软件包,但可以上传它们。我在这里使用DPI
包作为示例。似乎官方的sharelatex服务器在linux x86_64机器上运行。所以你的包需要在这样的机器上编译(例如ubunut 64)
~/R/x86_64-pc-linux-gnu-library/3.1/DPI
)DPI
文件夹DPI
文件夹中上传本地DPI
文件夹的内容DPI
library(DBI)
个软件包
醇>