Publications by Spencer Murrin
CodeAlong5_Ch5
Import data flights ## # A tibble: 336,776 × 19 ## year month day dep_time sched_de…¹ dep_d…² arr_t…³ sched…⁴ arr_d…⁵ carrier ## <int> <int> <int> <int> <int> <dbl> <int> <int> <dbl> <chr> ## 1 2013 1 1 517 515 2 830 819 11 UA ## 2 2013 1 1 533...
523 sym Python (20904 sym/51 pcs) 1 img
CodeAlong5_Ch4
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) ## [1] 1 2 3 4 5 6 7 8 9 10 Printing to screen y <- seq(from = 1, to = 10) y...
171 sym Python (229 sym/9 pcs)
Apply4
Import data State one question Dose the Cocoa Percent of the chocolate determine the rating factor? Plot data Interpret I made a scatter plot of the Cocoa percent based on ratings and found that some of the highest rating chocolate didn’t have the most potent Cocoa. The majority of the highest rating chocolate was between .6 and .8 percent. Th...
419 sym 1 img
Code4
Welcome Ch1 Introduction The data science project workflow Prerequisites R RStudio r packages Install the tidyverse package Running R code 1+2 ## [1] 3 Getting help Google Stackoverflow Ch2 Introduction to Data Exploration Ch3 Data Visualization Set up library(tidyverse) data mpg ## # A tibble: 234 × 11 ## manufacturer model di...
1377 sym R (1741 sym/12 pcs) 7 img
Test Publishing
library(tidyverse) ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.0 ✔ readr 2.1.4 ## ✔ forcats 1.0.0 ✔ stringr 1.5.0 ## ✔ ggplot2 3.4.1 ✔ tibble 3.1.8 ## ✔ lubridate 1.9.2 ✔ tidyr 1.3.0 ## ...
7 sym R (1634 sym/4 pcs)
Apply3
Import data # excel file data <- read_excel("data/MyData.xlsx") data ## # A tibble: 2,657 × 10 ## REF Compan…¹ Compa…² Revie…³ Count…⁴ Speci…⁵ Cocoa…⁶ Ingre…⁷ Most …⁸ Rating ## <dbl> <chr> <chr> <dbl> <chr> <chr> <dbl> <chr> <chr> <dbl> ## 1 2454 5150 U.S.A. 2019 Tanzan… Kokoa … ...
34 sym 1 img
Apply13
# Load packages # Core library(tidyverse) library(tidyquant) # Source function source("../00_scripts/simulate_accumlation.R") 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("HMC", "WMT", "TGT") prices <- tq_get(x = symbols...
1282 sym R (4978 sym/24 pcs) 1 img
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 = symbol...
451 sym R (8940 sym/36 pcs) 2 img
Apply12
# Load packages # Core library(tidyverse) library(tidyquant) 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 Choose your stocks from 2012-12-31 to present. symbols <- c("HMC", "WMT", "TGT") prices <- tq_get(x = symbols, ...
1044 sym R (18246 sym/22 pcs) 1 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”, “IJS”, �...
687 sym R (15501 sym/23 pcs) 2 img