Cache SQL chunk with R Markdown / Notebook without Knitting in RStudio

旧街凉风 提交于 2019-12-06 14:07:17

If you put cache=TRUE in the chunk options and you are working in rStudio, you can select a section of code and run it directly using the green arrows in the upper right of the rMarkdown/knitr console.

{sql output.var = "df", cache=TRUE} SELECT * FROM FakeData WHERE Date >= '2017-01-01

Also, I tend to run a regular R script in another window with EVERYTHING I am going to use in knitR. I find that I have less issues with package availability and caching if the data is stored in the global environment.

If you do it this way, and run with cache=TRUE you will definitely be able to save the data on the first run and skip the waiting next time around.

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