Publications by Sondre Asheim
Apply4
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...
242 sym 1 img
CodeAlong4-
Welcome Ch1 Introduction The data science project workflow Prerequisites R RStudio r packages Install the tidyverse package install.packages("tidyverse") library(tidyverse) Running R code 1+2 ## [1] 3 Getting help Google Stackoverflow Ch2 Introduction to Data Exploration Ch3 Data Visualization Set up library(tidyverse) ## Warning: packa...
1424 sym R (5155 sym/40 pcs) 23 img
Apply3-
Import data # excel file data <- read_excel("data/myData (1).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 #...
36 sym 1 img
CodeAlong3-
Do your work here. library(tidyverse) ## Warning: package 'tidyverse' was built under R version 4.3.2 ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.3 ✔ readr 2.1.4 ## ✔ forcats 1.0.0 ✔ stringr 1.5.0 ## ✔ ggpl...
27 sym R (1711 sym/5 pcs)
CodeAlong13
# Load packages # Core library(tidyverse) library(tidyquant) # time series library(timetk) Goal Simulate future portfolio returns five stocks: “SPY”, “EFA”, “IJS”, “EEM”, “AGG” market: “SPY” from 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x = ...
450 sym R (8809 sym/35 pcs) 2 img
Apply13
# Load packages # Core library(tidyverse) library(tidyquant) # Source function 1 Import stock prices Revise the code below. Replace symbols with your stocks. Replace the from and the to arguments to date from 2012-12-31 to present. symbols <- c("AAPL", "CL=F", "ROKU") prices <- tq_get(x = symbols, get = "stock.pric...
1378 sym R (5620 sym/27 pcs) 1 img
Apply12
# Load packages # Core library(tidyverse) library(tidyquant) library(readr) # Time series library(lubridate) library(tibbletime) # modeling library(broom) Goal Examine how each asset contributes to portfolio standard deviation. This is to ensure that our risk is not concentrated in any one asset. 1 Import stock prices Import your st...
1005 sym R (18555 sym/21 pcs) 2 img
CodeAlong12
# Load packages # Core library(tidyverse) library(tidyquant) library(readr) # Time series library(lubridate) library(tibbletime) # modeling library(broom) Goal Examine how each asset contributes to portfolio standard deviation. This is to ensure that our risk is not concentrated in any one asset. five stocks: “SPY”, “EFA”, �...
690 sym R (10317 sym/21 pcs) 2 img
Apply11
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...
556 sym 6 tbl
CodeAlong11
# Load packages # Core library(tidyverse) ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.3 ✔ readr 2.1.4 ## ✔ forcats 1.0.0 ✔ stringr 1.5.0 ## ✔ ggplot2 3.4.3 ✔ tibble 3.2.1 ## ✔ lubridate 1.9...
298 sym R (5131 sym/34 pcs)