Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 869 Bytes

File metadata and controls

37 lines (24 loc) · 869 Bytes

Writing computer programs for data analysis

author: John M. Drake & Ana I. Bento date: autosize: true

Data

Ebola or WNV mortality

Scripts

R programs are called scripts

  • Written in editor
  • Handy tools like syntax highlighting and error checking
  • Use # to indicate comments

Prototypical script

  1. Header (commented declaration of function, author, contact, date, and change log)
  2. Load libraries
  3. Declare functions
  4. Load data
  5. Analysis

Script is always evaluated in sequence

References

Wickham, H. 2010. A layered grammar of graphics. Journal of Computational and Graphical Statistics 19:3–28