Publications by Cody Grube
Apply 3
# Load Packages library(tidyquant) library(tidyverse) 1. Get Stock Prices and Convert to Returns Ra <- c("NVDA", "DELL", "DIS") %>% tq_get(get = "stock.prices", from = "2022-01-01") %>% group_by(symbol) %>% tq_transmute(select = adjusted, mutate_fun = periodReturn, period ...
291 sym R (3330 sym/11 pcs)
Code Along 3
# Load Packages library(tidyquant) ## Warning: package 'tidyquant' was built under R version 4.2.2 ## Loading required package: lubridate ## ## Attaching package: 'lubridate' ## The following objects are masked from 'package:base': ## ## date, intersect, setdiff, union ## Loading required package: PerformanceAnalytics ## Loading required...
161 sym R (4641 sym/27 pcs)
Code Along 1
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 ...
1380 sym R (1759 sym/12 pcs) 7 img
Apply to Your Data
Import stock prices stocks <- tq_get(c("NVDA", "DELL", "DIS"), get = "stock.prices", from = "2016-01-01") Plot stock prices stocks %>% ggplot(aes(x = date, y = adjusted, color = symbol)) + geom_line() ...
49 sym Python (213 sym/2 pcs) 1 img
Best Practice 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. I believe that this is true because economics can help you understand cost increases (Pag...
1533 sym
Real World Applications 1
Company Bank of New Hampshire Characteristics of the company Using Nexis Uni I was able to find some basic information on Bank of New Hampshire. The company was founded back in 1831 and I found that there are around 300 employees across 21 locations (as of September 8, 2022). The companies Headquarters are in Laconia, New Hampshire. Lastly, ...
500 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...
5405 sym 1 tbl
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...
5405 sym 1 tbl
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...
5405 sym 1 tbl
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...
5405 sym 1 tbl