r - Knitr 未加载/未找到?
问题描述
我最近将 RStudio 更新为 3.6.2 以获取一个包或我在 3.5 版本上无法使用的东西。但是,我不知道我的 knitr 问题是在更新之前还是之后开始的。我从呈现 rmarkdown 的 R 脚本开始。一旦开始渲染,它会说:
> rmarkdown::render(input = "file.rmd", params=list(Start_Date = rpt .... [TRUNCATED]
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘knitr’
Knitr 没有显示更新,当我尝试再次安装它时,它说:
> install.packages("knitr")
There is a binary version available but the source version is later:
binary source needs_compilation
knitr 1.27 1.28 FALSE
installing the source package ‘knitr’
trying URL 'https://cran.rstudio.com/src/contrib/knitr_1.28.tar.gz'
Content type 'application/x-gzip' length 884866 bytes (864 KB)
downloaded 864 KB
'\\file\path_file\myname'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
'\\file\path_file\myname\R\R-3.6.2' is not recognized as an internal or external command,
operable program or batch file.
Warning in install.packages :
installation of package ‘knitr’ had non-zero exit status
The downloaded source packages are in
‘K:\Users\AppData\Local\Temp\RtmpoJyMI4\downloaded_packages’
我真的不知道为什么会这样。我上周运行的这些文件运行良好。如果我缺少更多信息,请告诉我。
解决方案
更新:Windows 二进制文件现在在 CRAN 上可用;install.packages("knitr")
应该可以工作。
我不知道为什么 CRAN 上还没有最新的 Windows 二进制版本的knitr,但您不必安装最新版本。您可以options(install.packages.check.source = "no")
在安装软件包之前进行设置,它将安装较旧的二进制版本。
或者再等几天,直到在 CRAN 上提供二进制版本:https ://cran.r-project.org/package=knitr 。
推荐阅读
- python - 无法在此数据源中查找
- javascript - 关于我遇到的关于星球大战应用程序的问题
- javascript - 获取 Google 云存储中特定目录中的所有文件和子目录
- http-live-streaming - 警告:错误的管道:URI 没有源元素
- javascript - 如何插入链接,通过 JS 代码打开 URL,而不是直接跟随 URL?
- reactjs - 使用 accessToken 和 refreshToken 进行身份验证的问题
- java - 编辑后表格视图的单元格上的值未更新
- solr - 带有正斜杠的 Solr 查询不匹配
- oauth - Spring Cloud中的服务到服务api调用认证
- python - 来自其他文件的 Python 调用函数