Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 1008 Bytes

make-sure-code-runs-R.md

File metadata and controls

35 lines (27 loc) · 1008 Bytes
layout element title language
page
notes
Make Sure Code Runs
R
  • Review important steps for making sure your code runs everywhere
  • Important for class - your code has to run the on graders computer
  • Important for science
    • next day (who has gotten code working & had it not work the next day?)
    • desktop vs. laptop
    • collaborators
    • advisor

Make sure things you did before don't matter

  • Change something

  • Looks like it still works

  • Only works because of something you did earlier in the same session

  • Clear R environment using the broom icon on the Environment tab.

  • Run entire file using Source button or Ctrl-Shift-Enter

Make sure code works on other computers

  • Don't use setwd()
  • Use projects and relative paths
    • data/mydata.csv not C:\Users\Batman\DataCarp\data\mydata.csv
  • Filenames in code should match actual names exactly, including capitalization

Checklist

  • There is an Assignment Turn In Checklist to help
  • Show link on main page