From the course: Creating Reports and Presentations with R Markdown and RStudio

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Code chunks and global code chunk settings

Code chunks and global code chunk settings - RStudio Tutorial

From the course: Creating Reports and Presentations with R Markdown and RStudio

Start my 1-month free trial

Code chunks and global code chunk settings

- [Narrator] Of the many different components in R marked down document, "code chunks" are probably the most complex and where you'll spend most of your time writing. I've highlighted the two code chunks in the exercise files that we're going to look at in a minute or two. How do we know that we're looking at a code chunk exactly in an R marked down document? Well, they start and end with three backticks, and our studio colors them gray, so that we can easily tell them apart from the rest of our document where we're not writing R code. Code chunks have four components to them. The first is the "chunk language". This could be R, Ash, Python, SQL or some other language. For most R marked down users, the chunk language will be the R language, because that's what we are, we're people who write R code. After the chunk language, we can set a name for the code chunk. It's highly recommended that you always name your code chunks, so it's easier to troubleshoot the knitting process. After the…

Contents