Publications by Bella Kalinyak
Document
Import your data data("mtcars") mtcars <- as_tibble(mtcars) myData <- read_excel("myDataShort.xlsx") 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.090625 6.187500 ...
367 sym Python (6165 sym/33 pcs) 2 img
Publish Document
Ch20 Vectors Introduction Vector basics Important Types of Automic Vectors Using Automic Vectors sample(10) + 10 ## [1] 17 16 13 19 12 15 18 11 20 14 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 dat...
299 sym Python (3419 sym/66 pcs)
Document
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_u...
529 sym 4 tbl
Document
Introduction When Should You Write a Function? # Creat a data frame tibble::tibble( a = rnorm(10), b = rnorm(10), c = rnorm(10), d = rnorm(10) ) ## # A tibble: 10 × 4 ## a b c d ## <dbl> <dbl> <dbl> <dbl> ## 1 -0.105 1.09 2.14 -0.0444 ## 2 -1.02 -1.32 0.770 -0.382 ## 3 0.259 -0.14...
278 sym
Document
Import your data data <- read_excel("../00_data/myData.xlsx") Chapter 15 Create a factor food_levels <- c( "Pork", "Poultry", "Beef", "Lamb & Goat", "Fish", "Eggs", "Milk - inc. cheese", "Wheat and Wheat Products", "Rice", "Soybeans", "Nuts inc. Peanut Butter" ) Modify factor order Make two bar charts here - one before ordering another af...
284 sym 2 img
Document
Introduction String Basics chac_data <- "I'm 'very' hungry." chac_data <- 'I am "very" hunrgy.' stringr::str_length("I am hungry.") ## [1] 12 stringr::str_c("I", " am") ## [1] "I am" stringr::str_c("I", " am", sep = " ;") ## [1] "I ; am" stringr::str_c(c("I", " am"), collapse = "") ## [1] "I am" x <- c("Apple", "Banana", "Pear") stringr::str_...
388 sym Python (15898 sym/85 pcs)
Document
Import your data data <- read_excel("../00_data/myData.xlsx") Chapter 14 Tools Detect matches data$country ## [1] "Argentina" "Argentina" ## [3] "Argentina" "Argentina" ## [5] "Argentina" "Argentina" ## [7] "Argentina" "Argentina" ...
111 sym
Document
1. Import your data Import two related datasets from TidyTuesday Project. team_results <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2024/2024-03-26/team-results.csv') ## Rows: 236 Columns: 20 ## ── Column specification ─────────────────────────�...
1598 sym
Document
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 ...
204 sym Python (5374 sym/42 pcs)
Document
Import your data data <- read_excel("../00_data/myData.xlsx") Pivoting Minimizing data data %>% select(country, food_category, co2_emmission) %>% filter(country %in% c("Argentina", "Bermuda", "Japan")) ## # A tibble: 33 × 3 ## country food_category co2_emmission ## <chr> <chr> <dbl> ...
192 sym Python (6680 sym/19 pcs)