How to weave R code within Rst document?
The following code came from \sphinxhrefhttps://github.com/yihui/knitr-examples/blob/master/006-minimal.rstYihui Xie’s original post
\fvsethllines=, ,
{sphinxVerbatim}[commandchars=
{}]
library(tidyverse)
library(knitr)
\PYGZsh if I want that source code be visible in the output, do this
render\PYGZusrst(strict = TRUE)
\PYGZsh Otherwise, if you want the source code to be seen, comment out
\PYGZsh global chunk options
opts\PYGZuschunk\PYGZdlset(fig.width = t, fig.height = 5)
\PYGZsha plot
data(mtcars)
mtcars \PYGZpc\PYGZgt\PYGZpc
ggplot() +
geom\PYGZuspoint(aes(x = hp, y = mpg)) +
geom\PYGZussmooth(aes(x = hp, y = mpg))
\fvsethllines=, ,
{sphinxVerbatim}[commandchars=
{}]
\PYGc+c1\PYGZsh\PYGZsh ‘geom\PYGZussmooth()‘ using method = \PYGZsqloess\PYGZsq and formula \PYGZsqy \PYGZti x\PYGZsq