下面是我得到的错误:
Quitting from lines 46-48 (lesson3_student.rmd) Error in contrib.url(repos, "source") : trying to use CRAN without setting a mirror Calls: <Anonymous> ... withVisible -> eval -> eval -> install.packages -> contrib.url In addition: Warning message: In in_dir(opts_knit$get("root.dir") %n% input_dir(), evaluate::evaluate(code, : You changed the working directory to /Users/Madiyar/Desktop/Facebook Data (probably via setwd()). It will be restored to /Users/Madiyar/Downloads. See the Note section in ?knitr::knit Execution halted
感谢您的帮助
这个错误对我来说似乎很清楚; 你"trying to use CRAN without setting a mirror"
; 问题是针织以非交互模式运行。尝试推杆
options(repos="https://cran.rstudio.com" )
在您的代码中。顺便说一下,在编织代码中,您可能不应该
- 运行
install.packages()
(正如@hrbrmstr在通讯中所说,"[m]ost 人们想要管理他们自己的包库") - 调用
setwd()
手动设置工作目录