Knitr: Only show result without anything else

坚强是说给别人听的谎言 提交于 2019-12-11 16:27:12

问题


I can't seem to figure this out..

in R Studio with an rhtml file, I want this:

<!--begin.rcode test <-1  end.rcode-->

To look like this in the html output:

1

But it currently looks like this:

## [1] 1

Basically looking to build an html page around this.. So all the extra divs and code generated by the knitr notation need to be excluded.

racking my head on this one.


回答1:


  • echo controls the display of code
  • results controls the output of the code evaluations
  • message controls the messages
  • warning and error controls warnings and errors from the code evaluations.

    ```{r echo = FALSE, results = TRUE, message = FALSE, warning = FALSE, error = FALSE}
    
        # some code
    
    ```
    


来源:https://stackoverflow.com/questions/38649224/knitr-only-show-result-without-anything-else

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