Publications by Spencer Murrin
CodeAlong_10
Chapter 15 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… ...
480 sym 4 img
Apply_9
Import your data data <- read_excel("../01_module4/data/MyData.xlsx") data ## # A tibble: 2,657 × 10 ## REF Compan…¹ Compa…² Revie…³ Count…⁴ Speci…⁵ Cocoa…⁶ Ingre…⁷ Most.…⁸ Rating ## <dbl> <chr> <chr> <dbl> <chr> <chr> <dbl> <chr> <chr> <dbl> ## 1 2454 5150 U.S.A. 2019 Tanzan… Koko...
417 sym
CodeAlong_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 %>% glimpse(...
360 sym
Apply_8
Import your data chocolate <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2022/2022-01-18/chocolate.csv') ## Rows: 2530 Columns: 10 ## ── Column specification ──────────────────────────────────────────────�...
1203 sym
CodeAlong_8
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 1 x1 y1 ...
205 sym Python (5480 sym/43 pcs)
Apply_7
Import your data data <- read_excel("../01_module4/data/MyData.xlsx") data ## # A tibble: 2,657 × 10 ## REF Compan…¹ Compa…² Revie…³ Count…⁴ Speci…⁵ Cocoa…⁶ Ingre…⁷ Most.…⁸ Rating ## <dbl> <chr> <chr> <dbl> <chr> <chr> <dbl> <chr> <chr> <dbl> ## 1 2454 5150 U.S.A. 2019 Tanzan… Koko...
169 sym Python (5965 sym/14 pcs)
CodeAlong_7
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` `2000` #...
179 sym Python (2776 sym/16 pcs)
Apply_6
Import Data data <- read_excel("../01_module4/data/MyData.xlsx") data ## # A tibble: 2,657 × 10 ## REF Compan…¹ Compa…² Revie…³ Count…⁴ Speci…⁵ Cocoa…⁶ Ingre…⁷ Most.…⁸ Rating ## <dbl> <chr> <chr> <dbl> <chr> <chr> <dbl> <chr> <chr> <dbl> ## 1 2454 5150 U.S.A. 2019 Tanzan… Kokoa …...
294 sym R (4285 sym/18 pcs) 11 img
CodeAlong_6
Introduction Questions Variation Visualizing Distribution 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, ...
284 sym R (1850 sym/19 pcs) 15 img
Apply_5
Import data # excel file data <- read_excel("../01_module4/data/MyData.xlsx") data ## # A tibble: 2,657 × 10 ## REF Compan…¹ Compa…² Revie…³ Count…⁴ Speci…⁵ Cocoa…⁶ Ingre…⁷ Most.…⁸ Rating ## <dbl> <chr> <chr> <dbl> <chr> <chr> <dbl> <chr> <chr> <dbl> ## 1 2454 5150 U.S.A. 2019 Tanzan...
165 sym Python (7642 sym/12 pcs)