Publications by Daniel Lee
Apply to your data 4
1 Import stock prices of your choice Imported Stocks: Nidia, AMD, Intel, and Microsoft. 2 Convert prices to returns by quarterly ## # A tibble: 29 × 3 ## asset date returns ## <chr> <date> <dbl> ## 1 NVDA 2022-03-31 -0.0987 ## 2 NVDA 2022-06-30 -0.588 ## 3 NVDA 2022-09-30 -0.222 ## 4 NVDA 2022-12-30 0.186 ## 5 NVDA ...
467 sym 1 img
Apply 4
Import data # excel file data <- read_excel("../00_data/MyData.xlsx") data ## # A tibble: 100 × 12 ## Brand Model Year Kilometers_Driven Fuel_Type Transmission Owner_Type Mileage ## <chr> <chr> <dbl> <dbl> <chr> <chr> <chr> <dbl> ## 1 Toyo… Coro… 2018 50000 Petrol Manual First ...
324 sym 1 img
Document
# Load packages # Core library(tidyverse) ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.4 ✔ readr 2.1.5 ## ✔ forcats 1.0.0 ✔ stringr 1.5.1 ## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1 ## ✔ lubridate 1.9.3 ...
216 sym R (3917 sym/8 pcs) 1 img
Code Along 4
# Load packages # Core library(tidyverse) ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.4 ✔ readr 2.1.5 ## ✔ forcats 1.0.0 ✔ stringr 1.5.1 ## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1 ## ✔ lubridate 1.9.3 ...
216 sym R (3925 sym/8 pcs) 1 img
Code Along 3
# Load Packages library(tidyverse) ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.4 ✔ readr 2.1.5 ## ✔ forcats 1.0.0 ✔ stringr 1.5.1 ## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1 ## ✔ lubridate 1.9.3 ✔ t...
142 sym R (5208 sym/12 pcs)
Document
# Load Packages library(tidyverse) library(tidyquant) 1 Get stock prices and convert to returns Ra <- c("COST", "ELF", "GOOG") %>% tq_get(get = "stock.prices", from = "2022-01-01") %>% group_by(symbol) %>% tq_transmute(select = adjusted, mutate_fun = periodReturn, period = "mon...
375 sym R (3042 sym/11 pcs)
Charting with tidyquant
# Load packages library(tidyverse) # core functions ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.4 ✔ readr 2.1.5 ## ✔ forcats 1.0.0 ✔ stringr 1.5.1 ## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1 ## ✔ lubridate ...
64 sym R (5029 sym/13 pcs) 3 img
Preformance Analysis with tiduquant
# Load packages library(tidyverse) ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.4 ✔ readr 2.1.5 ## ✔ forcats 1.0.0 ✔ stringr 1.5.1 ## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1 ## ✔ lubridate 1.9.3 ✔ tid...
147 sym R (5205 sym/12 pcs)
Apply to your Data 3
# Load packages library(tidyverse) library(tidyquant) 1 Get stock prices and convert to returns Ra <- c("NVDA", "AMD", "MSFT") %>% tq_get(get = "stock.prices", from = "2022-01-01") %>% group_by(symbol) %>% tq_transmute(select = adjusted, mutate_fun = periodReturn, period = "monthl...
294 sym R (3139 sym/11 pcs)
tidyquant::tq_get
# Load packages library(tidyverse) ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.4 ✔ readr 2.1.5 ## ✔ forcats 1.0.0 ✔ stringr 1.5.1 ## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1 ## ✔ lubridate 1.9.3 ✔ tid...
115 sym R (3083 sym/11 pcs)