Week 1
Day 1
Welcome, create objects, vectors, tidy data, filter
- Welcome to open source
- Tour RStudio
- Start a new R project
- Create an R script
- Create, update and remove data
- Make a tidy data tables
- Add new R packages
- The
tidyverse
- The
- Read data
read_csv
for text files
- Save files
- Explore data
- Column names, rows, observations, value types
- Missing values
- Mean, max, min, quantile
- Filter data
Packages: tidyverse
Day 2
Excel files, arrange, select, group, summarize and add columns
- Read Excel files:
readxl
andread_excel( )
- Your data toolbox:
- Arrange, sort, and filter data
- Comparing data:
>
,==
,%in%
- Adding and calculating new columns
- New columns based on an
if
condition- If
age > 10
then “Eligible for vaccine”
- If
- Use the pipe
%>%
to chain functions together
- Summarize data
- Functions: mean, median, max, min, quantile
group_by
- Summarize by group or category
- By location: city, county, ZIP
Packages: readxl
Week 2
Day 3
Plots, grammar of graphics, geoms, labels, colors, facets
- Get visual with
ggplot2
- Grammar of graphics
- aesthetics and geoms
- Make ggplot sandwiches
- Scatterplots, text, and boxplots
- Add titles, colors, and labels
- Facets
- Reference lines
- Themes
- Save charts to a variety of formats
Packages: ggplot2
Day 4
All things maps, spatial functions, interactive
- Intro to Maps
- Coordinates and coordinate reference systems
- Spatial functions
- Distances, buffers, intersections
- Interactive maps
- Leaflet
- Layers, labels, legends
- Points, polygons, markers
Packages: sf
, leaflet
Week 3
Day 5
Table joins, clean_names, date formats, date parts, time series
- Join tables
left_join
- library(janitor)
clean_names()
- Working with Dates
- Format conversion
- Date/time parts:
year
,day
,hour
- Time zones
- Time series plots
Packages: lubridate
Day 6
Review, reading code, wide data, databases, markdown
- Connect to databases
- ODBC
keyring
: Keep your passwords secret
- Wide format data <–> Long data
- R markdown reports
- Choose your own adventure!
Packages: DBI
, RODBC
, keyring