Publications by Daniel Lee
Code Along 8
# 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 symbol <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x = symbol, ...
424 sym R (2731 sym/14 pcs) 2 img
Code Along 8 DA
# Load packages # Core library(tidyverse) library(nycflights13) Introduction nycflights13 Keys Mutating joins Inner join x <- tribble( ~key, ~val_x, 1, "x1", 2, "x2", 3, "x3" ) y <- tribble( ~key, ~val_y, 1, "y1", 2, "y2", 4, "y3" ) inner_join(x, y) ## # A tibble: 2 × 3 ## key val_x val_y ## <dbl> <ch...
197 sym R (4979 sym/34 pcs)
Code along 8
# Load packages # Core library(tidyverse) library(tidyquant) Goal Measure portfolio risk using kurtosis. It describes the fatness of the tails in probability distributions. In other words, it measures whether a distribution has more or less returns in its tails than the normal distribution. It matters to investors because a distribution with exce...
809 sym R (3857 sym/16 pcs) 3 img
Apply 7
Import your data big_tech_stock_prices <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2023/2023-02-07/big_tech_stock_prices.csv') ## Rows: 45088 Columns: 8 ## ── Column specification ──────────────────────────────────────�...
171 sym Python (6471 sym/16 pcs)
Codealong8
Introduction nycflights13 Keys Mutating joins Inner join x <- tribble( ~key, ~val_x, 1, "x1", 2, "x2", 3, "x3" ) y <- tribble( ~key, ~val_y, 1, "y1", 2, "y2", 4, "y3" ) inner_join(x, y) ## Joining with `by = join_by(key)` ## # A tibble: 2 × 3 ## key val_x val_y ## <dbl> <chr> <chr> ## 1 1 x1 y1 ...
205 sym Python (5274 sym/43 pcs)
Apply 7 DA
Import your data data <- read.csv("../00_data/ramen_ratings.csv") set.seed(1234) data_small <- data %>% select(country, brand, stars) %>% sample_n(5) data_small ## country brand stars ## 1 South Korea Ottogi 2.80 ## 2 Taiwan Tung-I 3.00 ## 3 Thailand MAMA 3.75 ## 4 Singapore KOKA 5.00 ## 5 Vietnam Vifon 2.0...
166 sym Python (1839 sym/11 pcs)
Apply Data 6
# Load packages # Core library(tidyverse) library(tidyquant) Goal Visualize expected returns and risk to make it easier to compare the performance of multiple assets and portfolios. Choose your stocks. from 2012-12-31 to 2017-12-31 1 Import stock prices # Choose stocks symbols <- c("SPOT", "ISRG", "KHC", "FIS", "GOOG") # Using tq_get() -...
1276 sym R (6492 sym/17 pcs) 6 img
Apply5
# 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("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x= symbols, get ="stock.prices", ...
678 sym R (2778 sym/17 pcs) 3 img
Apply 7 FA
# Load packages # Core library(tidyverse) library(tidyquant) Goal Visualize and compare skewness of your portfolio and its assets. Choose your stocks. from 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("NKE", "NFLX", "AMZN", "AAPL", "MSFT") prices <- tq_get(x = symbols, from = "2012-12-31", to ...
1368 sym R (2769 sym/16 pcs) 1 img
Code Along 7 FA
# 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, ...
438 sym R (4278 sym/18 pcs) 3 img