API209: Summer Math Camp
August 15, 2024
Rony Rodriguez-Ramirez (G2)
Ed Policy (Economics of Education) Program
Previous exp: The World Bank (DIME; DECRG), IPA
Like coding!
What should you expect from me?
At the end of this summer camp?
What are we going during math camp (R Part)?
8 sessions over the next weeks:
There is a website for this summer camp:
It is not up-to-date; but every week, you will have the materials for that respective week, i.e., you should have already your lab for tomorrow.
Coding is a Skill
It is most fun to practice a skill with people you know.
Class is a collective enterprise!
Why R?
Why RStudio?
Why Positron?
RStudio vs. Positron
Mastering Data Manipulation in R
The tidyverse is a collection of R packages designed for data science.
They share an underlying design philosophy, grammar, and data structures.
Core Packages:
ggplot2
- Data visualizationdplyr
- Data manipulationtidyr
- Data tidyingreadr
- Data importpurrr
- Functional programmingtibble
- Modern data framesstringr
- String manipulationforcats
- Categorical dataCommonly Used Functions:
filter()
- Subset rows based on conditionsselect()
- Choose columns by namesmutate()
- Create new columns or modify existing onesarrange()
- Reorder rowssummarize()
- Aggregate datagroup_by()
- Group data for summary operations# A tibble: 39 × 3
name height hair_color
<chr> <int> <chr>
1 Darth Vader 202 none
2 Biggs Darklighter 183 black
3 Obi-Wan Kenobi 182 auburn, white
4 Anakin Skywalker 188 blond
5 Chewbacca 228 brown
6 Boba Fett 183 black
7 IG-88 200 none
8 Bossk 190 none
9 Qui-Gon Jinn 193 brown
10 Nute Gunray 191 none
# ℹ 29 more rows
As of now, you should have the tools to understand the last code. More resources are available in our website. Now, it’s time to make some mistakes!
“There is no way of knowing nothing about a subject to knowing something about a subject without going through a period of much frustration and suckiness.”
“Push through. You’ll suck less.”
Hadley Wickham, author of {ggplot2}