Content adapted from Candace Savonen.
Content adapted from Candace Savonen.
Regularly cleaning your environment and trying your code again, can help ensure that your code is running as expected.
Occasionally we might forget to save a step of our code in our R Markdown file that we ran only in the console. This will help us figure that out.
Regularly checking if your file knits will help you spot a missing step or error earlier when you have less code to try to identify where your code might have gone wrong.
Provide sufficient detail so that you can understand what you did.
Use set.seed()
: sets the starting state for the random number generator (RNG) in R.
[1] 10 7 6 3 1 2 5 9 4 8
Before:
After knit:
Go to Help > Cheat Sheets > R Markdown Cheat Sheet (which will download it)
Or checkout Help > Cheat Sheets > R Markdown Reference Guide
Or checkout the 🏠 Class Website!
🏠 Class Website
💻 Lab
These are just some quick tips, for more information:
To help make your work more reproducible:
Image by Gerd Altmann from Pixabay