Publications by Daniel Lee
Document
# 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, ...
441 sym R (3915 sym/21 pcs) 2 img
Document
# Load packages library(tidyverse) library(tidyquant) 1 Import stock prices of your choice # Choose stocks symbols <- c("MSFT", "COKE", "GOOG", "A", "F") prices <- tq_get(x = symbols, get = "stock.prices", from = "2022-01-01", to = "2022-12-31") 2 Convert prices to returns by quarterly asset_returns_tbl<- pric...
205 sym R (1568 sym/7 pcs) 1 img
Document
# Load packages # Core library(tidyverse) ## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ── ## ✔ ggplot2 3.4.0 ✔ purrr 1.0.0 ## ✔ tibble 3.1.8 ✔ dplyr 1.0.10 ## ✔ tidyr 1.2.1 ✔ stringr 1.5.0 ##...
218 sym R (2969 sym/10 pcs) 1 img
Publish Document
Import stock prices stocks <- tq_get(c("GOOGL", "MSFT", "COKE"), get = "stock.prices", from = "2018-01-01", to = "2023-05-01") stocks ## # A tibble: 4,020 × 8 ## symbol date open high low close volume adjusted ## <chr> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> ## 1 G...
185 sym Python (5479 sym/13 pcs) 1 img
Document
Import stock prices stocks <- tq_get(c("GOOGL", "MSFT", "COKE"), get = "stock.prices", from = "2018-01-01", to = "2023-05-01") stocks ## # A tibble: 4,020 × 8 ## symbol date open high low close volume adjusted ## <chr> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> ## 1 G...
50 sym Python (1097 sym/3 pcs) 1 img
Document
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) ## ── Attaching packages ─────────────────...
1378 sym R (2295 sym/13 pcs) 7 img
Apply 10: Topic modeling for #TidyTuesday Bigfoot sightings
Our modeling goal is to “discover” topics in the lyrics of Spice Girls songs. Instead of a supervised or predictive model where our observations have labels, this is an unsupervised approach. https://juliasilge.com/blog/spice-girls/ equivalent terms between bigfoot and spice girls data song_name = observations topic = classification librar...
2492 sym R (9720 sym/36 pcs) 2 img
Intermediate DA: Apply9 Stocks
Explore Data library(tidyverse) ## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ── ## ✔ ggplot2 3.4.0 ✔ purrr 1.0.1 ## ✔ tibble 3.1.8 ✔ dplyr 1.0.10 ## ✔ tidyr 1.3.0 ✔ stringr 1.5.0 ## ✔ re...
1425 sym R (11433 sym/32 pcs) 2 img
Apply 10: Powerlifting
Import your data The data came from here ipf_lifts <- readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-10-08/ipf_lifts.csv") ## Rows: 41152 Columns: 16 ## ── Column specification ──────────────────────────────────────...
380 sym 2 img
How to navigate economic cycles
U.S Economy: market indicators U.S Economy: economic indicators National Cycles of the Industry How is the economy in New Hampshire? What you should be doing to prepare...
183 sym