我尝试在 RStudio 版本 1.4.904 和 R 版本 4.0.3 中安装“rmarkdown”,但出现以下错误。我无法打开新的 rmarkdown 并编织 rmarkdown 文件。每次我尝试时,都会弹出此消息,
R Markdown documents requires an updated version of the rmarkdown package. Do you want to install this package now?
有人可以帮我吗?
安装.packages(ç,依赖项= TRUE)
Installing package into ‘/Users/Library/R/4.0/library’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
rmarkdown 2.3 2.4 FALSE
installing the source package ‘rmarkdown’
trying URL 'http://cran.utstat.utoronto.ca/src/contrib/rmarkdown_2.4.tar.gz'
Content type 'application/x-gzip' length 3202546 bytes (3.1 MB)
==================================================
downloaded 3.1 MB
Warning in file(con, "r") :
cannot open file '/var/db/timezone/zoneinfo/+VERSION': No such file or directory
dyld: lazy symbol binding failed: Symbol not found: _utimensat
Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib (which was built for Mac OS X 10.13)
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: _utimensat
Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib (which was built for Mac OS X 10.13)
Expected in: /usr/lib/libSystem.B.dylib
/Library/Frameworks/R.framework/Resources/bin/INSTALL: line 34: 30112 Done echo 'tools:::.install_packages()'
30113 Abort trap: 6 | R_DEFAULT_PACKAGES= LC_COLLATE=C "${R_HOME}/bin/R" $myArgs --no-echo --args ${args}
Warning in install.packages :
installation of package ‘rmarkdown’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/70/lgr12kdn6wn_k36sscnc0_dw0000gn/T/Rtmpmc0jUR/downloaded_packages’```
下载二进制 tgz (https://cran.r-project.org/web/packages/rmarkdown/index.html) 并直接从中安装。
应该可以。我有几乎同样的问题,我就是这样解决的。请随时通知我! F
我也遇到了类似的问题,花了半天时间才得到正确的解决方案。
我遵循的步骤:
卸载现有版本
安装了 R 的更新版本 - R 版本 4.0.4 (2021-02-15).
单击“文件”->“新建文件”->“R markdown”。它要求安装 Rmarkdown 软件包。
记下我需要安装的软件包
在 R 源上输入 install.packages("rmarkdown", dependency = TRUE)(可以在 R 控制台上完成)
然后我尝试单独安装 Rmarkdown 软件包,它对我有用。以下是我需要安装的软件包。
安装.packages('knitr') install.packages('tinytex') 安装.packages('base64enc') install.packages('摘要') 安装.packages('jsonlite') install.packages('htmltools') install.packages('rmarkdown')
一种更具技术性的解决方法,但它对我有用。