Can't change params in Rmd documents

冷暖自知 提交于 2019-12-05 03:08:23

The error message indicates you have already got an object named params in your current workspace, and you should remove it (rm(params)) before calling rmarkdown::render(). Use ls() to double check the objects in the current environment.

Alternatively - knit the document in a new environment by including the option envir = new.env():

rmarkdown::render("test.Rmd", params = list(name = "Jordan"), envir = new.env() )

I like to do this in any case to make sure the rmarkdown report only uses objects that were explicitly defined as part of its own code.

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