Publications by Justin Shokal
Apply 3
# Load packages library(tidyverse) library(tidyquant) 1 Get stock prices and convert to returns Ra <- c("TSLA", "HD", "TGT") %>% tq_get(get = "stock.prices", from = "2022-01-01") %>% group_by(symbol) %>% tq_transmute(select = adjusted, mutate_fun = periodReturn, period = "...
283 sym R (3363 sym/11 pcs)
Code Along 3 Performance Analysis
# Load packages library(tidyverse) ## Warning: package 'tidyverse' was built under R version 4.2.2 ## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ── ## ✔ ggplot2 3.3.6 ✔ purrr 0.3.4 ## ✔ tibble 3.1.8 ✔ dpl...
144 sym R (4433 sym/14 pcs)
Code Along 2 Chapter 5
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 ...
542 sym Python (21147 sym/51 pcs) 1 img
Code Along 2 Chapter 4
Coding basics R as a calculator 1000 / 10 ## [1] 100 x <- 1000 / 10 x ## [1] 100 assignment symbol What’s in a name? Calling functions Use of TAB seq(from = 1, to = 10) ## [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)...
172 sym Python (231 sym/10 pcs)
Apply 2
Import stock prices stocks <- tq_get(c("HD", "LOW", "AMZN"), get = "stock.prices", from = "2016-01-01") stocks ## # A tibble: 5,364 × 8 ## symbol date open high low close volume adjusted ## <chr> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> ## 1 HD 2016-01-04 130. 131. 129....
205 sym Python (5387 sym/19 pcs) 1 img
Apply 1
Import stock prices stocks <- tq_get(c("HD", "LOW", "AMZN"), get = "stock.prices", from = "2016-01-01") stocks ## # A tibble: 5,343 × 8 ## symbol date open high low close volume adjusted ## <chr> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> ## 1 HD 2016-01-04 130. 131. 12...
50 sym Python (1076 sym/3 pcs) 1 img
Code Along 1
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) ## Warning: package 'tidyverse' was built under R version 4.2.2 data mpg ## #...
1397 sym R (2700 sym/20 pcs) 16 img
Best Practices 1
Chapter 1 It’s Not Just about Forecasting The following are the key points in the chapter. Elaborate on each point in at least 30 words. Understanding economics can help you to diagnose the causes of increases or decreases in sales volumes and costs. *If you have an understanding of economics you can better predict events in the economy an...
1440 sym
Real World Applications 1
Company Bank of New Hampshire Characteristics of the company Describe the company in at least 50 words. Find the company information from the Nexis Uni database. Include characteristics such as the number of employees, sales revenues, product lines, and the industry. Bank of New Hampshire is the oldest and one of the largest independent bank...
585 sym
Best Practices 2
## # A tibble: 1,096 × 5 ## # Groups: symbol [8] ## symbol date price change text ## <chr> <date> <dbl> <dbl> <glue> ## 1 GDPC1 1947-01-01 2034. NA 1947.1, ## Growth: NA ## 2 GDPC1 1947-04-01 2029. -0.00267 1947.2, ## Growth: -0.3% ## 3 GDPC1 1947-07-01 2025. -0.00207 1...
1967 sym 1 tbl