- Programming language
- Statistics and data analysis environment
Setup
- Does everyone have R and RStudio installed?
- Open RStudio, check to see if console sees R
RStudio
- IDE - Integrated Development Environment
- Text editor, with highlighting and information about problems with code
- Interpreter
- Project management
- Working directly in interpreter
- Writing code and running it from the editor
-
Clearing the global environment
- Information in Environment/History
- Integrated help (start typing, F1 for more info)
Projects
- Who here uses
setwd()
? - Start a new project
- Create a
data
subdirectory - Add an example csv file
- Load it
Project structure
- Two common structures
- src in top-level directory with subdirectories for data, results, etc (possibly with subdirectories of their own)
- src in a separate subdirectory
Assignments
- Output using
cat("1: ", answer)
orcat("1.1: ", answer)
- Comment before each problem:
#Problem 1