Publications by Mackenzie Labrie

Apply8 redo

06.11.2022

Import your data myData <- read.csv("../00_data/boardgames_details.csv") %>% as_tibble() myData %>% skimr::skim() Data summary Name Piped data Number of rows 21631 Number of columns 23 _______________________ Column type frequency: character 10 numeric 13 ________________________ Group variables None Variable type: character skim_var...

475 sym 3 tbl

Apply7redo

06.11.2022

Import your data myData <- read.csv("../00_data/boardgames_details.csv") Pivoting long to wide form # Make data set smaller first data_small <- myData %>% select(primary, yearpublished, minplayers) %>% filter(primary %in% c("Robin Hood", "Chaos")) #wide form data_wide <- data_small %>% pivot_wider(names_from = yearpublished, values_fro...

162 sym Python (1595 sym/7 pcs)

Code Along 11

14.11.2022

CH19 Functions Introduction When should you 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) ) # Re-scale each column df$a <- (df$a - min(df$a, na.rm = TRUE)) / (max(df$a, na.rm = TRUE) - min(df$a, na.rm = TRUE)) df$b <- (...

308 sym

Apply 11

17.11.2022

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_...

579 sym 7 tbl

Code Along 13

29.11.2022

CH20 Vectors 1 Introduction 2 Vector basics 3 Important types of atomic vector 4 Using atomic vectors sample(10) + 10 ## [1] 19 16 13 14 18 20 12 17 15 11 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 ...

364 sym Python (2132 sym/52 pcs)

Apply13

02.12.2022

Import your data data("mtcars") mtcars <- as_tibble(mtcars) myData <- read.csv("../00_data/boardgames_details.csv") Repeat the same operation over different columns of a data frame Case of numeric variables mtcars %>% map_dbl(.x = ., .f = ~mean(x = .x)) ## mpg cyl disp hp drat wt qsec ## 20.09062...

362 sym Python (5958 sym/30 pcs) 2 img

Conclusion

08.12.2022

Import your data myData <- read.csv("../00_data/boardgames_details.csv") Define question What year were the most board games published? Explain data and variables My data is all about board games. There are 23 variables in this data set. A few variables in the data set are: description of the board games, the year they were published, minimum a...

2316 sym Python (673 sym/6 pcs) 1 img