简体   繁体   English

我在 R 中的 markdown 文件中不断出现编织错误

[英]I keep getting a knit error with my markdown file in R

I am receiving this error when trying to knit my R markdown sheet我在尝试编织我的 R markdown 表时收到此错误

Error in contrib.url(repos, "source"): trying to use CRAN without setting a mirror calls: ... withVisible -> eval -> eval -> install.packages -> contrib.url Execution halted contrib.url 中的错误(repos,“source”):尝试使用 CRAN 而不设置镜像调用:... withVisible -> eval -> eval -> install.packages -> contrib.url 执行停止

Does anyone have any experience with this?有人对这个有经验么?

Without the exact code, it is difficult to assess the problem.如果没有确切的代码,就很难评估问题。 However, as @NelsonGon writes, this is usually the error from running an installation ( install.packages() inside a chunk.但是,正如@NelsonGon 所写,这通常是运行安装的错误( install.packages()在块内。

Instead, the library should be installed beforehand and loaded with library(example ) inside a chunk to make it available for the markdown environment.相反,应该预先安装该库并在一个块中加载library(example ),以使其可用于 markdown 环境。

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

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