O'Reilly logo

Learning RStudio for R Statistical Computing by Edwin de Jonge, Mark van der Loo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Code chunks

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.

Chunk syntax and options

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.

RMarkdown: .Rmd files

Code chunks are indicated ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required