Publications by Tindra Bergstrand
Code Along 12
Chapter 20 Vectors Introduction Vector basics Important types of autonic vector Using autonic vectors sample(10) + 10 ## [1] 20 17 15 19 13 14 11 12 16 18 1:10 + 1:2 ## [1] 2 4 4 6 6 8 8 10 10 12 1:10 + 1:3 ## Warning in 1:10 + 1:3: longer object length is not a multiple of shorter object ## length ## [1] 2 4 6 5 7 9 8 10 12 11...
338 sym Python (2134 sym/52 pcs)
Apply 11
Import your data data(flights) flights %>% skimr::skim() Data summary Name Piped data Number of rows 336776 Number of columns 19 _______________________ Column type frequency: character 4 numeric 14 POSIXct 1 ________________________ Group variables None Variable type: character skim_variable n_missing complete_rate min max empty n_un...
545 sym 4 tbl
Code Along 11
Introduction When should yu write a function? # For reproducible work set.seed(1234) # Create a data frame df <- tibble::tibble( a = rnorm(10), b = rnorm(10), c = rnorm(10), d = rnorm(10) ) # Rescale each colum df$a <- (df$a - min(df$a, na.rm = TRUE)) / (max(df$a, na.rm = TRUE) - min(df$a, na.rm = TRUE)) df$b <- (df$b - min(df$b, na.rm...
185 sym
Apply10
Import your data # excel filer games <- read_excel("../00_data/MyData_charts.xlsx") games ## # A tibble: 988 × 15 ## year country city stage home_team away_team home_score away_score outcome ## <dbl> <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <chr> ## 1 1930 Uruguay Montev… Grou… France Mexico ...
253 sym 3 img
CodeAlong10
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…...
464 sym 6 img
Apply 9
Import Data # excel filer games <- read_excel("../00_data/MyData_charts.xlsx") games ## # A tibble: 988 × 15 ## year country city stage home_team away_team home_score away_score outcome ## <dbl> <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <chr> ## 1 1930 Uruguay Montev… Grou… France Mexico 4 ...
117 sym
Code Along 9
Introduction String Basics chac_data <- "i am 'very' hungry" stringr::str_length("I am hungry.") ## [1] 12 stringi::stri_c(c("I", "am"), collapse = "") ## [1] "Iam" stringr::str_c("I", "am", sep = ";") ## [1] "I;am" stringi::stri_sort(c("John", "Marry", "Aaron")) ## [1] "Aaron" "John" "Marry" Matching Patterns with regular expressions flights %...
365 sym
Apply8
Import Data # excel filer games <- read_excel("../00_data/MyData_charts.xlsx") games ## # A tibble: 988 × 15 ## year country city stage home_team away_team home_score away_score outcome ## <dbl> <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <chr> ## 1 1930 Uruguay Montev… Grou… France Mexico 4 ...
409 sym
Code Along 8
Introduction nycflights13 Keys Mutating joints 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 1 x1 y1 ...
201 sym Python (5154 sym/40 pcs)
Apply 7
Import your data # excel filer games <- read_excel("../00_data/MyData_charts.xlsx") games ## # A tibble: 988 × 15 ## year country city stage home_team away_team home_score away_score outcome ## <dbl> <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <chr> ## 1 1930 Uruguay Montev… Grou… France Mexico ...
162 sym Python (9845 sym/14 pcs)