I am currently writing documentation for the R package hosted on GitHub . I use knitr along with R Markdown to write a README file. Clicking the Knit HTML button in RStudio creates the HTML code as I expected.
However, clicking README.rmd on GitHub leads to what you see at the bottom of the page, following the link above. For example, the topmost code snippet is declared in the README.rmd file as follows:
```{r global_options, include = FALSE} library(knitr) options(width = 120) opts_chunk$set(fig.width = 12, fig.height = 8, fig.path = 'Figs/', include = TRUE, warning = FALSE, message = FALSE) ```
However, the include = FALSE statement in the first line of code is simply ignored in this case, and the piece of code that was supposed to be hidden is displayed on the GitHub linking page. In addition, the results (for example, from plot() , head() ) are not visualized, although opts_chunk$set(..., include = TRUE) .
Has anyone encountered a similar problem and can I help me render the README document correctly, i.e. how does RStudio handle this on github?
source share