RStudio notebook does not show data.frames when I compile

吃可爱长大的小学妹 提交于 2019-12-11 04:32:49

问题


I have a temporary windows 7 laptop (32 bit) on which I have R 3.3.2 and RStudio 1.0.44.

I am using RStudio notebook, and it works fine when I execute code in its window. However, as I compile to html (pressing Preview), the data.frames disappear (there is a chunk with no output). Everything else (vectors or figures) are shown. It seems to be linked to the new cute printing format for data.frames that the notebook exploits. Indeed, if I use R-markdown (switching to output: html_document), the data.frames are shown with no problem in the basic R format. Any help is appreciated.


回答1:


For the ones having this problem, it turned out the issue was related to rmarkdown 1.2.
I solved installing rmarkdown 1.1:

remove.packages("rmarkdown")
library(devtools)
install_version("rmarkdown", version = "1.1", 
                repos = "http://cran.us.r-project.org")

Then everything worked.



来源:https://stackoverflow.com/questions/40830688/rstudio-notebook-does-not-show-data-frames-when-i-compile

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