Check That Your Code Runs (Data Analysis)
Sometimes you think you’re code runs, but it only actually works because of something else you did previously. To make sure it actually runs you should save your work and then run it in a clean environment.
Follow these steps in RStudio to make sure your code really runs:
1. Restart R (see above) by clicking Session
in the menu bar and selecting Restart R
:
2. If the Environment
tab isn’t empty click on the broom icon to clear it:
The Environment
tab should now say “Environment Is Empty”:
3. Rerun your entire homework assignment using “Source with Echo” to make sure it runs from start to finish and produces the expected results.