Class 2
Introduction to R
GEOG 215
AGENDA
Today’s Class …
During Class …
Next Class …
What is R?
Class 2
3
Pros and Cons
Class 2
4
Very powerful - all steps of data science process
Versatile - spatial and non spatial data
Open-source and popular
Spread across many packages
Base R functionality is not sufficient
Much slower compared to other programming languages
Uses a lot of memory
Not as good for “Big Data”
R and R Studio
Class 2
5
R – refers to the programming language and the software that interprets the code
RStudio – Graphical user interface and wrapper (GUI) for R. Extends functionalities of R and helps with writing code
R Markdown (.Rmd)
Class 2
6
Storage Options
Class 2
7
Be very careful that you are not relying on data already in the R environment from previous sessions!
Always read data in for each separate .R file or .Rmd file!
Source
Console
Environment/History
Files and more
Working Directory
How does R / RStudio know what is the working directory?
Class 2
12
Working Directory Cntd.
Class 2
13
File Paths
Class 2
14
Absolute
Relative
Class 2
15
Console vs Script
Class 2
16
Packages
Class 2
17
Packages
Class 2
18
Introduction to R In Class Exercise