Publications by Tucker Moore
Document
Tidy data Pivoting long to wide form table4a ## # A tibble: 3 × 3 ## country `1999` `2000` ## <chr> <dbl> <dbl> ## 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 (4068 sym/22 pcs)
Document
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 %>% gli...
362 sym
Document
Introduction nycflights13 Keys Mutating joins Inner join 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 ...
205 sym Python (5397 sym/43 pcs)
Document
Introduction Question2 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...
285 sym R (1774 sym/20 pcs) 14 img
Document
Import data Apply the following dplyr verbs to your data Filter rows Arrange rows Select columns Add columns Summarize by groups...
153 sym
Document
Coding basics R as a calculator 1000 / 10 ## [1] 100 x <- 1000 / 10 # x assignment symbol What’s in a name? Calling functions Use of TAB seq(from = 1, to = 10, by = 1) ## [1] 1 2 3 4 5 6 7 8 9 10 continuation character, + seq(from = 1, to = 10) ## [1] 1 2 3 4 5 6 7 8 9 10 Printing to screen y <- seq(from = 1, to = 10) ...
171 sym Python (231 sym/9 pcs)
Document
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 ...
525 sym Python (20154 sym/51 pcs) 1 img
Apply4
Import data State one question Which Hot Ones season had the hottest group of wings? Plot data Interpret It seems that the earlier seasons of the show did not feature very spicy sauces but from episode five and on they were all relativley similar in scovilles....
276 sym 1 img
Document
Welcome Ch1 Introduction The data science project workflow Prerequisites R RStudio r packages Install the tidyverse package Running R code 1+2 ## [1] 3 Getting help Google Stackoverflow Ch2 Introduction to Data Exploration Ch3 Data Visualization Set up library(tidyverse) ## Warning: package 'tidyverse' was built under R version 4.3.3 ## ...
1380 sym R (1767 sym/13 pcs) 6 img