Publications by Sondre Asheim
Apply7
Import your data # excel file myData <- read_excel("../00_data/myData.xlsx") myData ## # A tibble: 27 × 35 ## country country_code year `Cardiovascular diseases (%)` `Cancers (%)` ## <chr> <chr> <dbl> <dbl> <dbl> ## 1 World OWID_WRL 1990 26.5 12.2 ## 2...
169 sym Python (9797 sym/14 pcs)
CodeAlong7
Tidy data Pivoting long to wide form table4a ## # A tibble: 3 × 3 ## country `1999` `2000` ## <chr> <dbl> <dbl> ## 1 Afghanistan 745 2666 ## 2 Brazil 37737 80488 ## 3 China 212258 213766 table4a_long <- table4a %>% pivot_longer(cols = c(`1999`, `2000`), names_to = "year", ...
169 sym Python (4073 sym/22 pcs)
Apply6
Introduction Questions Variation Visualizing distributions ggplot(data = myData) + geom_bar(mapping = aes(x = country)) Typical values myData %>% # filter out Cancers filter(`Cancers (%)` < 12) ## # A tibble: 0 × 35 ## # ℹ 35 variables: country <chr>, country_code <chr>, year <dbl>, ## # Cardiovascular diseases (%) <dbl>...
338 sym R (1411 sym/10 pcs) 5 img
Apply5revised
Import data # excel file myData <- read_excel("../00_data/myData.xlsx") myData ## # A tibble: 27 × 35 ## country country_code year `Cardiovascular diseases (%)` `Cancers (%)` ## <chr> <chr> <dbl> <dbl> <dbl> ## 1 World OWID_WRL 1990 26.5 12.2 ## 2 Worl...
205 sym Python (8183 sym/20 pcs)
CodeAlong6
Introduction Questions Variation Visualizing distributions 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 ...
289 sym R (2040 sym/22 pcs) 15 img
Apply5
Import data ## # A tibble: 27 × 35 ## country country_code year `Cardiovascular diseases (%)` `Cancers (%)` ## <chr> <chr> <dbl> <dbl> <dbl> ## 1 World OWID_WRL 1990 26.5 12.2 ## 2 World OWID_WRL 1991 26.6 12.4 #...
195 sym
Apply4revised
Import data # excel file myData <- read_excel("../00_data/myData.xlsx") myData ## # A tibble: 27 × 35 ## country country_code year `Cardiovascular diseases (%)` `Cancers (%)` ## <chr> <chr> <dbl> <dbl> <dbl> ## 1 World OWID_WRL 1990 26.5 12.2 ## 2 Worl...
331 sym 1 img
CodeAlong5CH4
Coding basics R as a calculator 1000 / 10 ## [1] 100 x <- 1000 / 10 # x assignment symbol What’s in a name? Calling functions Use of TAB seq(from = 1, to = 10, by = 1) ## [1] 1 2 3 4 5 6 7 8 9 10 continuation character, + seq(from = 1, to = 10, by = 1) ## [1] 1 2 3 4 5 6 7 8 9 10 Printing to screen y <- seq(from = 1, t...
171 sym Python (239 sym/9 pcs)
CodeAlong5CH5
Import data flights ## # A tibble: 336,776 × 19 ## year month day dep_time sched_dep_time dep_delay arr_time sched_arr_time ## <int> <int> <int> <int> <int> <dbl> <int> <int> ## 1 2013 1 1 517 515 2 830 819 ## 2 2013 1 1 533 529 ...
514 sym Python (20154 sym/51 pcs) 1 img
Apply3revised
Import data # excel file data <- read_excel("data/myData.xlsx") data ## # A tibble: 6,156 × 35 ## country country_code year `Cardiovascular diseases (%)` `Cancers (%)` ## <chr> <chr> <dbl> <dbl> <dbl> ## 1 Afghanistan AFG 1990 17.6 4.03 ## 2...
36 sym 1 img