Publications by Daniel Lee

Apply 10 FA

13.11.2024

# Load packages # Core library(tidyverse) library(tidyquant) Goal Calculate and visualize your portfolio’s beta. Choose your stocks and the baseline market. from 2012-12-31 to present 1 Import stock prices symbols <- c("WMT", "AAPL", "NKE", "NFLX", "MSFT") prices <- tq_get(x = symbols, from = "2012-12-31", ...

1086 sym R (2790 sym/16 pcs) 1 img

Document

12.11.2024

# Load packages # Core library(tidyverse) library(tidyquant) Goal Visualize and examine changes in the underlying trend in the performance of your portfolio in terms of Sharpe Ratio. Choose your stocks. from 2012-12-31 to present 1 Import stock prices symbols <- c("GM", "NOK", "GOOGL", "HMC", "NVDA") prices <- tq_get(x = symbols, ...

991 sym R (3502 sym/16 pcs) 1 img

CodeAlong11

12.11.2024

# Load packages # Core library(tidyverse) library(lubridate) library(nycflights13) Introduction Functions When should you write a function? # For reproducible work set.seed(1234) # Create a data frame df <- tibble::tibble( a = rnorm(10), b = rnorm(10), c = rnorm(10), d = rnorm(10) ) # Re-scale each column df$a <-...

303 sym R (2738 sym/27 pcs)

Apply10DA

11.11.2024

Import your data nhl_rosters <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2024/2024-01-09/nhl_rosters.csv') ## Rows: 54883 Columns: 18 ## ── Column specification ─────────────────────────────────────────────...

291 sym 2 img

Code Along 11

11.11.2024

# Load packages # Core library(tidyverse) library(tidyquant) Functions When should you write a function # For reproducible work set.seed(1234) # Creat a data frame df <- tibble::tibble( a = rnorm(10), b = rnorm(10), c = rnorm(10), d = rnorm(10) ) # Rescale each column df$a <- (df$a - min(df$a, na.rm = TRUE)) / (max(df$a, na.rm = TRUE)...

161 sym R (2497 sym/25 pcs)

Code Along 11 FA

11.11.2024

Ch19 Functions Introduction When should you write a function? # For reproducible work set.seed(1234) # Creat a data frame df <- tibble::tibble( a = rnorm(10), b = rnorm(10), c = rnorm(10), d = rnorm(10) ) # Rescale each column df$a <- (df$a - min(df$a, na.rm = TRUE)) / (max(df$a, na.rm = TRUE) - min(df$a, na.rm = TRUE)) df$b <- (df$b...

291 sym

Code along 11 DA

11.11.2024

Ch19 Functions Introduction When should you write a function? # For reproducible work set.seed(1234) # Creat a data frame df <- tibble::tibble( a = rnorm(10), b = rnorm(10), c = rnorm(10), d = rnorm(10) ) # Rescale each column df$a <- (df$a - min(df$a, na.rm = TRUE)) / (max(df$a, na.rm = TRUE) - min(df$a, na.rm = TRUE)) df$b <- (df$b...

291 sym

Document

11.11.2024

# Load packages # Core library(tidyverse) library(tidyquant) 1 Import stock prices # 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 sto...

483 sym R (4909 sym/19 pcs) 3 img

CodeAlong10

08.11.2024

# Load packages # Core library(tidyverse) library(tidyquant) Goal Visualize and examine changes in the underlying trend in the performance of your portfolio in terms of Sharpe Ratio. Choose your stocks. from 2012-12-31 to present 1 Import stock prices symbols <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x= symbols, ...

357 sym R (3546 sym/17 pcs) 2 img

Apply 10

08.11.2024

# Load packages # Core library(tidyverse) library(tidyquant) Goal Calculate and visualize your portfolio’s beta. Choose your stocks and the baseline market. from 2012-12-31 to present 1 Import stock prices symbols <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x= symbols, get ="stock.prices", ...

1354 sym R (3514 sym/17 pcs) 2 img