Publications by vanessarnaas
Document - Apply to data 9
Import your data bee_colonies <- read_excel("../00_data/MyData3.xlsx") set.seed(123) bee_colonies_small <- bee_colonies %>% select(year, months, state, colony_size, colony_lost) %>% sample_n(10) Chapter 14 Tools Detect matches bee_colonies_small %>% summarise(sum(str_detect(colony_size, "^2"))) ## # A tibble: 1 × 1 ## `sum(str_de...
127 sym
Document - Code Along 9
Introduction string basics chac_data <- "I am Vanessa" chac_data2 <- 'I am "Vanessa".' stringr::str_length("I am Vanessa.") ## [1] 13 stringr::str_c(c("I", " am"), collapse = "") ## [1] "I am" stringr::str_c("I ", " am", sep = "-") ## [1] "I - am" name <- "Vanessa" time_of_day <- "morning" birthday <- FALSE str_c("Good ", time_of_day, " ", name...
342 sym
Document - Apply to data 8
Import your data bee_colonies <- read_excel("../00_data/MyData3.xlsx") stressors <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2022/2022-01-11/stressor.csv') ## Rows: 7332 Columns: 5 ## ── Column specification ─────────────────────────────�...
937 sym
Document - Code Along 8
Introduction nycflights13 Keys Mutating joints Inner joints 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 y...
212 sym Python (6648 sym/45 pcs)
Document Apply to data 7
Import your data bee_colonies <- read_excel("../00_data/MyData3.xlsx") bee_colonies_smaller <- bee_colonies %>% select(year, state, colony_lost) %>% filter(state %in% c("California", "North Dakota")) Pivoting long to wide form bee_colonies_smaller <- bee_colonies %>% select(year, state, colony_size) bee_colonies_smaller %...
167 sym Python (4312 sym/12 pcs)
Document Code Along 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 table4a_long %>% pivot_wider(names_from = year, values_from = cases) ## # A tibble: 3 × 3 ## country `1999` `2000` ## <chr> <dbl>...
174 sym Python (2605 sym/16 pcs)
Document Apply to data 6
Import data # excel file bee_colonies <- read_excel("../00_data/MyData3.xlsx") Introduction Questions Variation Visualizing distributions ggplot(data = bee_colonies) + geom_bar(mapping = aes(x = months)) bee_colonies %>% count(months) ## # A tibble: 4 × 2 ## months n ## <chr> <int> ## 1 April-June 329 ##...
207 sym R (1804 sym/21 pcs) 8 img
Document Code Along 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, ...
285 sym R (1924 sym/20 pcs) 16 img
Document apply to data 5
Import data # excel file data <- read_excel("../00_data/MyData3.xlsx") data ## # A tibble: 1,222 × 10 ## year months state colony_size colony_max colony_lost colony_lost_pct ## <dbl> <chr> <chr> <dbl> <chr> <dbl> <dbl> ## 1 2015 January-March Alaba… 7000 7000 1800 ...
420 sym Python (14868 sym/36 pcs)
Publish Document Apply 4
Import data # excel file data <- read_excel("../00_data/MyData3.xlsx") data ## # A tibble: 1,222 × 10 ## year months state colony_size colony_max colony_lost colony_lost_pct ## <dbl> <chr> <chr> <dbl> <chr> <dbl> <dbl> ## 1 2015 January-March Alaba… 7000 7000 1800 ...
414 sym 1 img