Publications by vanessarnaas
DAT3000 - Apply 2
Goal: predict the prices of IKEA items Click here for the data #Import Data ikea <- read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-11-03/ikea.csv') ## New names: ## Rows: 3694 Columns: 14 ## ── Column specification ## ───────────────────────────...
275 sym R (23123 sym/24 pcs) 3 img 4 tbl
Code Along 2
Goal: to predict the rental prices in the SF rental market Click here for the data. Import Data rent <- read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2022/2022-07-05/rent.csv') ## Rows: 200796 Columns: 17 ## ── Column specification ─────────────────────────...
310 sym R (22110 sym/21 pcs) 4 img 3 tbl
Apply to data 1
Goal: predict the prices of IKEA items Click here for the data #Import Data ikea <- read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-11-03/ikea.csv') ## New names: ## Rows: 3694 Columns: 14 ## ── Column specification ## ───────────────────────────...
237 sym 3 img 4 tbl
Code Along 1
Goal: to predict the rental prices in the SF rental market Click here for the data. Import Data rent <- read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2022/2022-07-05/rent.csv') ## Rows: 200796 Columns: 17 ## ── Column specification ─────────────────────────...
309 sym 4 img 3 tbl
Publish Document - Apply to data 12
Import your data bee_colony <- read_excel("../00_data/MyData3.xlsx") Repeat the same operation over different columns of a data frame Case of numeric variables bee_colony %>% select(where(is.numeric)) %>% map_dbl(.x = ., .f = ~mean(x = .x, na.rm = TRUE)) ## year colony_size colony_lost colony_lost_pct ## 2017.76923 1235...
163 sym
Document - Code Along 12
Chapter 20: Vectors Introduction Vector basics Important types of automic vector Using atomic vectors sample(10) + 10 ## [1] 16 14 18 12 15 11 19 20 13 17 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...
372 sym Python (2740 sym/60 pcs)
Document - Apply to data 11
Import your data bee_colony <- read_excel("../00_data/MyData3.xlsx") bee_colony %>% skimr::skim() Data summary Name Piped data Number of rows 1222 Number of columns 10 _______________________ Column type frequency: character 6 numeric 4 ________________________ Group variables None Variable type: character skim_variable n_missing compl...
281 sym 3 tbl
Document - Code along 11
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) ) # Rescale 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 <- (df$b - min(df$b,...
293 sym
Document - Apply to data 10
Import your data bee_colonies <- read_excel("../00_data/MyData3.xlsx") Chapter 15 Create a factor Modify factor order Unordered factor levels # Average colony_lost for each period colonylost_by_period <- bee_colonies %>% group_by(months) %>% summarise( avg_colonylost = mean(colony_lost, na.rm = TRUE) ) colonylost_by_period...
203 sym 2 img
Document - Code Along 10
Chapter 15 - factors Creating factors x1 <- c("Dec", "Apr", "Jan", "Mar") x2 <- c("Dec", "Apr", "Jam", "Mar") sort(x1) ## [1] "Apr" "Dec" "Jan" "Mar" # Sorting levels month_levels <- c( "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ) y1 <- factor(x1, levels = month_levels) General Social Survey gss_cat ...
476 sym 6 img