Publications by Amanda Simpson
Code Along 10
Ch15 Factors Creating factors General Social Survey gss_cat ## # A tibble: 21,483 × 9 ## year marital age race rincome partyid relig denom tvhours ## <int> <fct> <int> <fct> <fct> <fct> <fct> <fct> <int> ## 1 2000 Never married 26 White $8000 to 9999 Ind,near … Prot… Sout… 12 ...
395 sym 3 img
Code Along 9
Introduction String basics chac_data <- "I'm 'very' hungry." stringr::str_length("I am hungry.") ## [1] 12 stringr::str_c(c("I", " am"), collapse = "") ## [1] "I am" stringr::str_c("I", " am", sep = " ;") ## [1] "I ; am" str_sort(c("John", "Mary", "Aaron")) ## [1] "Aaron" "John" "Mary" Matching patterns with regular expressions flights %>% glim...
362 sym
Apply 9
Import your data results <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-09-07/results.csv') ## Warning: One or more parsing issues, see `problems()` for details ## Rows: 25220 Columns: 18 ## ── Column specification ────────────────────────�...
109 sym
Code Along 8
# Load package library(tidyverse) ## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ── ## ✔ ggplot2 3.3.6 ✔ purrr 0.3.4 ## ✔ tibble 3.1.8 ✔ dplyr 1.0.10 ## ✔ tidyr 1.2.0 ✔ stringr 1.4.1 ## ✔...
208 sym R (5953 sym/46 pcs)
Apply 8
Import your data results <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-09-07/results.csv') ## Warning: One or more parsing issues, see `problems()` for details ## Rows: 25220 Columns: 18 ## ── Column specification ────────────────────────�...
422 sym 3 tbl
Apply 7
Import your data results <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-09-07/results.csv') ## Warning: One or more parsing issues, see `problems()` for details ## Rows: 25220 Columns: 18 ## ── Column specification ────────────────────────�...
204 sym Python (3295 sym/15 pcs) 3 tbl
Code Along 7
Tidy data Pivoting long to wide form table4a ## # A tibble: 3 × 3 ## country `1999` `2000` ## * <chr> <int> <int> ## 1 Afghanistan 745 2666 ## 2 Brazil 37737 80488 ## 3 China 212258 213766 table4a_long <- table4a %>% pivot_longer(cols = c(`1999`, `2000`), names_to = "year", ...
170 sym Python (4062 sym/22 pcs)
Code Along 6
Introduction Questions Variation Visualizing distributions diamonds %>% ggplot(aes(x = cut)) + geom_bar() diamonds %>% ggplot(mapping = aes(x = carat)) + geom_histogram(binwidth = 0.5) diamonds %>% filter(carat < 3) %>% ggplot(aes(x = carat)) + geom_histogram(binwidth = 0.5) diamonds %>% ggplot(aes(x ...
286 sym R (1973 sym/20 pcs) 15 img
Apply 6
Import Data data <- read_excel("../00_data/myData.xlsx") data ## # A tibble: 25,220 × 18 ## resultId raceId driverId constr…¹ number grid posit…² posit…³ posit…⁴ points ## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> <chr> <dbl> <dbl> ## 1 1 18 1 1 22 1 "1" 1 ...
277 sym 5 img
Apply 5
Import data # excel file data <- read_excel("../00_data/myData.xlsx") data ## # A tibble: 20 × 4 ## raceId fastestLapTime driverId laps ## <dbl> <chr> <dbl> <dbl> ## 1 1056 "1:14.621" 832 78 ## 2 1056 "1:14.649" 830 78 ## 3 1056 "1:14.670" 846 78 ## 4 1056 "1:14.552" ...
211 sym Python (5307 sym/14 pcs)