R Markdown
This post shows how to format your RMarkdown. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
Markdown
1 |
|
Also you can also indent the blocks by four spaces.
Code Chunk options
Chunk output can be customised with options, arguments needs to be supplied to chunk header. We will look at most important set of options below, but you an access full list for more options.
eval = FALSE
prevents code from being evaluated, so obviously no results will be generated.
include = FALSE
runs the code, but doesn’t show the code or results in the final document.
echo = FALSE
prevents code, but not the results from appearing in the finished file.
message = FALSE
or warning = FALSE
prevents messages or warnings from appearing in the finished file.
results = 'hide'
hides printed output;
fig.show = 'hide'
hides plots.
error = TRUE
causes the render to continue even if code returns an error.
collapse =TRUE
to merge text output and source code into a single code block in the output.