Publications by Spencer Murrin

Apply11

20.04.2023

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_un...

703 sym 4 tbl

Apply10

13.04.2023

# Load packages # Core library(tidyverse) library(tidyquant) Goal Calculate and visualize your portfolio’s beta. Choose your stocks and the baseline market. from 2012-12-31 to present 1 Import stock prices symbols <- c("SPY", "HMC", "WMT", "TGT") prices <- tq_get(x = symbols, from = "2012-12-31", to = "...

1087 sym R (2761 sym/16 pcs) 1 img

CodeAlong11

18.04.2023

# Load packages # Core library(tidyverse) library(tidyquant) library(lubridate) Ch19 Functions Introduction When should you write a function? # For reproducible work set.seed(1234) # Creat 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, n...

308 sym R (2505 sym/26 pcs)

CodeAlong10

11.04.2023

# Load packages # Core library(tidyverse) library(tidyquant) Goal Collect individual returns into a portfolio by assigning a weight to each stock five stocks: “SPY”, “EFA”, “IJS”, “EEM”, “AGG” from 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x = symbols, ...

475 sym R (3425 sym/17 pcs) 2 img

Apply9

06.04.2023

# Load packages # Core library(tidyverse) library(tidyquant) Goal Visualize and examine changes in the underlying trend in the performance of your portfolio in terms of Sharpe Ratio. Choose your stocks. from 2012-12-31 to present 1 Import stock prices symbols <- c("HMC", "WMT", "TGT") prices <- tq_get(x = symbols, get = "stock...

1168 sym R (3428 sym/16 pcs) 1 img

CodeAlong9

04.04.2023

# Load packages # Core library(tidyverse) library(tidyquant) Goal Collect individual returns into a portfolio by assigning a weight to each stock five stocks: “SPY”, “EFA”, “IJS”, “EEM”, “AGG” from 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x = symbols, ...

448 sym R (4791 sym/18 pcs) 3 img

Apply8

28.03.2023

# Load packages # Core library(tidyverse) library(tidyquant) Goal Visualize and examine changes in the underlying trend in the downside risk of your portfolio in terms of kurtosis. Choose your stocks. from 2012-12-31 to present 1 Import stock prices symbols <- c("HMC", "WMT", "TGT") prices <- tq_get(x = symbols, get = "stock.p...

1151 sym R (3488 sym/15 pcs) 1 img

CodeAlong8

27.03.2023

# Load packages # Core library(tidyverse) library(tidyquant) Goal Collect individual returns into a portfolio by assigning a weight to each stock five stocks: “SPY”, “EFA”, “IJS”, “EEM”, “AGG” from 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x = symbols, ...

430 sym R (3839 sym/16 pcs) 3 img

Apply7

21.03.2023

# Load packages # Core library(tidyverse) library(tidyquant) Goal Visualize and compare skewness of your portfolio and its assets. Choose your stocks. from 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("HMC", "WMT", "TGT") prices <- tq_get(x = symbols, get = "stock.prices", from = "2012-12-31", ...

1235 sym R (3426 sym/19 pcs) 1 img

CodeAlong7

21.03.2023

# Load packages # Core library(tidyverse) library(tidyquant) Goal Collect individual returns into a portfolio by assigning a weight to each stock five stocks: “SPY”, “EFA”, “IJS”, “EEM”, “AGG” from 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x = symbols, ...

438 sym R (4414 sym/18 pcs) 3 img