2.5 Running Chunks

You can run section of code with Cmd/Ctrl + Shift + Enter, like Sweave, or execute all the code with the green arrow at the top-right corner of the chunk.

Unlike Sweave, by default code chucks are executed inline, so that you see the output immediately beneath the code chuck, like this:

If you prefer to have the output sent to the Console and the Plots pane instead, then you can you can change this option.

In the RStudio menu: Tools > Global Options > R Markdown > Show output inline for all R Markdown Documents. Uncheck This