作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
第一次使用R_Markdown
我创建了一个新的 R_Markdown 并试图将它编织成 PDF。当我这样做时,出现以下错误
processing file: R_markdown.Rmd
|.......... | 14%
ordinary text without R code
|.................... | 29%
label: setup (with options)
List of 1
$ include: logi FALSE
|.............................. | 43%
ordinary text without R code
|........................................ | 57%
label: cars
|.................................................. | 71%
ordinary text without R code
|............................................................ | 86%
label: pressure (with options)
List of 1
$ echo: logi FALSE
|......................................................................| 100%
ordinary text without R code
output file: R_markdown.knit.md
"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS R_markdown.utf8.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output R_markdown.tex --lua-filter "C:\Users\faiel\Documents\R\win-library\4.0\rmarkdown\rmarkdown\lua\pagebreak.lua" --lua-filter "C:\Users\faiel\Documents\R\win-library\4.0\rmarkdown\rmarkdown\lua\latex-div.lua" --self-contained --highlight-style tango --pdf-engine pdflatex --variable graphics --variable "geometry:margin=1in"
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'xfun' 0.17 is already loaded, but >= 0.19 is required
Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace
Execution halted
我不明白为什么会这样。我尝试了以下
install.packages("rmarkdown")
和
update.packages(ask = FALSE, checkBuilt = TRUE)
tinytex::tlmgr_update()
但没有任何运气
最佳答案
loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) 错误:namespace 'xfun' 0.17 已加载,但 >= 0.19 是必需的
如果您发现上述错误,您可以使用以下解决方案来消除错误。同样的方法可以用于任何包。(代替 xfun 任何包名都可以存在)。
解决方案:
在 RStudio 中,导航至 -> 工具 -> 检查包更新,您可以在此处选择包并进行更新。如果这不起作用,请更新 R 版本并尝试更新包。
通过执行上述方法,包将更新到较新的版本。
关于r - 将 R_markdown 编织成 PDF 时加载命名空间出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64701557/
第一次使用R_Markdown 我创建了一个新的 R_Markdown 并试图将它编织成 PDF。当我这样做时,出现以下错误 processing file: R_markdown.Rmd |..
我是一名优秀的程序员,十分优秀!