Publications by Max Haussmann
Code Along 9
Introduction String Basics chac_data <- "I'm 'very' hungry." stringr::str_length("I am hungry.") ## [1] 12 stringr::str_c("I", " am", sep = " ;") ## [1] "I ; am" stringr::str_c(c("I", " am"), collapse = "") ## [1] "I am" str_sort(c("John", "Mary", "Aaron")) ## [1] "Aaron" "John" "Mary" Matching patterns with regular expressions flights %>% glim...
362 sym
Apply to your Data 8
1. Import your data Import two related datasets from TidyTuesday Project. full_trains <- read.csv("../00_data/data/full_trains") small_trains <- read.csv("../00_data/data/small_trains") 2. Make data small full_trains_small <- full_trains %>% select(year, num_late_at_departure, departure_station) %>% sample_n(10) small_trains_small <- small_trains...
3264 sym
Code Along 8
Introduction nycflights13 keys Mutating joins x <- tribble( ~key, ~val_x, 1, "x1", 2, "x2", 3, "x3" ) y <- tribble( ~key, ~val_y, 1, "y1", 2, "y2", 4, "y3" ) inner_join(x,y) ## Joining with `by = join_by(key)` ## # A tibble: 2 × 3 ## key val_x val_y ## <dbl> <chr> <chr> ## 1 1 x1 y1 ## 2 2 ...
191 sym Python (5282 sym/42 pcs)
Apply to your Data 7
Import your data library(readxl) # excel file data <- read_excel("../00_data/data/myData.xlsx") data ## # A tibble: 9,355 × 12 ## work_year job_title job_category salary_currency salary salary_in_usd ## <dbl> <chr> <chr> <chr> <dbl> <dbl> ## 1 2023 AI Architect Machine Learning… USD ...
420 sym R (7974 sym/15 pcs)
Module 8: Code Along 7
Tidy data Pivoting long to wide from table4a_long <- table4a %>% pivot_longer(cols = c('1999', '2000'), names_to = "year", values_to = "cases") wide to long form table4a_long %>% pivot_wider(names_from = year, values_from = cases) ## # A tibble: 3 × 3 ## country `1999` `2000` ##...
160 sym Python (2486 sym/16 pcs)
Apply to your Data 6
Import data library(readxl) # excel file data <- read_excel("../00_data/data/myData.xlsx") data ## # A tibble: 9,355 × 12 ## work_year job_title job_category salary_currency salary salary_in_usd ## <dbl> <chr> <chr> <chr> <dbl> <dbl> ## 1 2023 AI Architect Machine Learning… USD ...
302 sym R (3091 sym/19 pcs) 12 img
Code Along 6
Introduction Question 2 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 = carat,...
873 sym R (2093 sym/21 pcs) 16 img
Apply to your Data 5
Import data # excel file data <- read_excel("../00_data/data/myData.xlsx") data ## # A tibble: 9,355 × 12 ## work_year job_title job_category salary_currency salary salary_in_usd ## <dbl> <chr> <chr> <chr> <dbl> <dbl> ## 1 2023 AI Architect Machine Learning… USD 305100 ...
269 sym Python (3964 sym/9 pcs)
Code Along 5//Ch5
Import data flights ## # A tibble: 336,776 × 19 ## year month day dep_time sched_dep_time dep_delay arr_time sched_arr_time ## <int> <int> <int> <int> <int> <dbl> <int> <int> ## 1 2013 1 1 517 515 2 830 819 ## 2 2013 1 1 533 529 ...
344 sym Python (19806 sym/51 pcs) 1 img
Apply to my Data 4
Import data # excel file data <- read_excel("../00_data/data/myData.xlsx") data ## # A tibble: 9,355 × 12 ## work_year job_title job_category salary_currency salary salary_in_usd ## <dbl> <chr> <chr> <chr> <dbl> <dbl> ## 1 2023 AI Architect Machine Learning… USD 305100 ...
373 sym 1 img