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.
Name your code chunks sensibly - RStudio Tutorial
From the course: Creating Reports and Presentations with R Markdown and RStudio
Name your code chunks sensibly
- [Instructor] It's important when our markdown documents to try to remember to give your code chunks sensible names that explain what a code chunk does. For instance, import or wrangle data, or make a histogram. When naming your chunks, you must only use Roman characters, digits, or dashes. Things will go very badly for you if you use underscores or other special characters in your chunk names. It is extremely common however, to forget to name your code chunks. I do it all the time. It's particularly difficult to name your code chunk before you've actually started writing the code that you put in it. Thankfully, there's a great package called namer for automatically naming your code chunks. It's recommended that you use the namer add-in, before knitting a document together. Let's have a look at how all of this works together in practice, by navigating to our exercise files in 04_01, and we'll open up our Rstudio project. Okay, let's open up my RMarkdown file. This RMarkdown file…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.