Publications by Spencer Murrin

CodeAlong6

05.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, ...

401 sym R (4087 sym/21 pcs) 2 img

Code Along 5

27.02.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 = symb...

354 sym R (2699 sym/14 pcs) 3 img

Apply5

27.02.2023

# Load packages # Core library(tidyverse) library(tidyquant) Goal Collect individual returns into a portfolio by assigning a weight to each stock 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, from = "2012-12-31", t...

749 sym R (2326 sym/12 pcs) 1 img

CodeAlong4

20.02.2023

# Load packages # Core library(tidyverse) ## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ── ## ✔ ggplot2 3.3.6 ✔ purrr 1.0.1 ## ✔ tibble 3.1.8 ✔ dplyr 1.0.10 ## ✔ tidyr 1.3.0 ✔ stringr 1.5....

217 sym R (2862 sym/8 pcs) 1 img

Apply4

20.02.2023

1 Import stock prices of your choice 2 Convert prices to returns by quarterly ## # A tibble: 60 × 3 ## asset data returns ## <chr> <date> <dbl> ## 1 HMC 2012-03-30 0.208 ## 2 HMC 2012-06-29 -0.0965 ## 3 HMC 2012-09-28 -0.115 ## 4 HMC 2012-12-31 0.184 ## 5 HMC 2013-03-28 0.0398 ## 6 HMC 201...

350 sym 1 img

Apply3

16.02.2023

# Load packages library(tidyverse) library(tidyquant) 1 Get stock prices and convert to returns Ra <- c("HMC", "WMT", "TGT") %>% tq_get(get = "stock.prices", from = "2022-01-01") %>% group_by(symbol) %>% tq_transmute(select = adjusted, mutate_fun = periodReturn, period = ...

344 sym R (3304 sym/11 pcs)

CodeAlong3_PreformanceAnalysis

14.02.2023

# Load packages library(tidyverse) ## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ── ## ✔ ggplot2 3.3.6 ✔ purrr 1.0.1 ## ✔ tibble 3.1.8 ✔ dplyr 1.0.10 ## ✔ tidyr 1.3.0 ✔ stringr 1.5.0 ## �...

142 sym R (4308 sym/12 pcs)

Code Along 1

31.01.2023

Welcome Ch1 Introduction The data science project workflow Prerequisites R RStudio r packages Install the tidyverse package Running R code Getting help Google Stackoverflow Ch2 Introduction to Data Exploration Ch3 Data Visualization Set up library(tidyverse) data mpg ## # A tibble: 234 × 11 ## manufacturer model displ year ...

1396 sym R (4869 sym/28 pcs) 7 img