Saving only some of information from R Markdown .Rmd file into .html


I like to use R Markdown for all of my work. So far I have been knitting the entire project into HTML. However, now I would like to knit only the important portions mainly graphs and results and not the coding. Is there a way to do that? I have always worked in one giant .Rmd file. I am not sure if I can make some small files that are somehow linked to each other. Maybe this can be potential solution.

Any help with this will be appreciated!

Thank you!

You can remove the code by using the option "echo=FALSE" in the code chunks.

If you go into RStudio and create a new RMD document, the last example shows this.

```{r pressure, echo=FALSE}

You can also set this globally at the beginning by doing something like this

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
1 Like

Thank you so much @StatSteph!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.