-
Book Overview & Buying
-
Table Of Contents
Learning RStudio for R Statistical Computing
In all of the markup systems supported by RStudio, chunks of R code can be embedded and executed. There are many options controlling how the code andits results are shown in the report, how resulting figures should be displayed, and so on.
Each markup system has its own syntax to distinguish R code from regular text, but in every system it is possible to label code chunks and to pass processing options. Both labeling and optioning are not mandatory and can be left out, so default settings will be used. The following is an overview of the code chunk denominators. You do not have to remember any of them; for each file type, the Chunks menu has the Insert chunk option.
Code chunks are indicated with triple backticks:
'''{r <label>, <option>=<value>,... }
# Your R code here
'''Inline code is enclosed in single backticks:
'r <R code>'
Code chunks are indicated as special HTML comment sections:
<...
Change the font size
Change margin width
Change background colour