如何在 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