Error in YAML with R Markdown

假如想象 提交于 2019-11-29 15:31:58
sebastian zapata
  1. Install the devtools package from CRAN.
  2. In R, run the following:

    library(devtools)

    install_github('viking/r-yaml')

I took a while to fix this as well. It seems the new knitr needs a version of yaml 2.2.0 and above.

This help from @ScientificProgrammer on github here https://github.com/viking/r-yaml/issues/56#issuecomment-441394840 helped me. The solution was to install the new package using devtools from within standard R not RStudio. I did get some compiler error messages but it seemed to work. So don't let that put you off.

So inside Standard R assuming you have the devtools package

library(devtools)
devtools::install_github("viking/r-yaml")

I am copying their answer over in full below to help people in case the link breaks:

In case it helps, I was having the same problem as IndrajeetPatil when I tried to run devtools::install_github("viking/r-yaml") from within RStudio. If I ran install.packages("viking/r-yaml") from within RStudio, the problem was resolved.

However, when I exited RStudio and ran devtools::install_github("viking/r-yaml") from within the standard R client, I still received the same compiler warnings, but the problem also went away.

P.S. Another popular solution that helped some people was to delete the yaml directory completely e.g. using Windows Explorer. Restart RStudio Ctrl + Shift + F10, and then re-install yaml package. That did not work for me as it kept giving me just 2.1.18 version.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!