Publications by Jack Tortolani
CodeAlong10DA
Chapter 15 Introduction 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...
397 sym 3 img
Apply9DA
Import your data rosters <- read_excel("../00_data/myData.xlsx", sheet = "nhl_rosters") %>% head(50) rosters ## # A tibble: 50 × 18 ## team_code season position_type player_id headshot first_name last_name ## <chr> <dbl> <chr> <dbl> <chr> <chr> <chr> ## 1 ATL 19992000 forwards ...
116 sym
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 %>% gl...
363 sym
Apply 7 DA
Import your data data <- read_excel("../00_data/myData.xlsx", sheet = "nhl_rosters") data ## # A tibble: 54,883 × 18 ## team_code season position_type player_id headshot first_name last_name ## <chr> <dbl> <chr> <dbl> <chr> <chr> <chr> ## 1 ATL 19992000 forwards 8467867 https://ass...
156 sym Python (3771 sym/12 pcs)
Apply6DA
Import data data <- read.csv("../00_data/myData.csv") Introduction Questions Variation Visualizing distributions data %>% ggplot(aes(x = birth_country)) + geom_bar(fill = "orange") data %>% ggplot(mapping = aes(x = birth_year)) + geom_histogram(binwidth = 0.5, fill = "red") Typical values data %>% # Filter out peopl...
293 sym R (1536 sym/18 pcs) 10 img
Code Along 7DA
Tidy data Pivoting Separating and Uniting Missing Values Non-Tidy Data...
84 sym
CA7DA
Tidy data Pivoting Long to Wide Form 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` `20...
180 sym Python (2696 sym/16 pcs)
CodeAlong8
Introduction nycflights13 Keys Mutating joins Inner 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 ...
206 sym Python (5392 sym/43 pcs)
Code Along 6
Introduction Question2 Variation Visualizing distributions diamonds %>% ggplot(aes(x = cut)) + geom_bar(fill = "orange") diamonds %>% ggplot(mapping = aes(x = carat)) + geom_histogram(binwidth = 0.5, fill = "red") diamonds %>% filter(carat < 3) %>% ggplot(aes(x = carat)) + geom_histogram(binwidth = 0.7, fil...
302 sym R (2013 sym/21 pcs) 14 img
Apply 5
Import data Apply the following dplyr verbs to your data Filter rows Arrange rows Select columns Add columns Summarize by groups WOW! 100 Mile House is a town! The Median year for an NHL player from there town that was born was in 1966....
263 sym 1 img