Publications by Daniel Lee
Code Along 6
# 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 # Choose stocks symbols <- c("SPY", "EFA", "IJS", "EEM", "AGG") # Using tq...
341 sym R (6413 sym/17 pcs) 6 img
Code Along 6
Introduction Question2 Variation Visualizing Distributions diamonds %>% ggplot(aes(x = cut)) + geom_bar() diamonds %>% ggplot(mapping = aes(x = carat)) + geom_histogram(binwidth = 0.5) diamonds %>% filter(carat < 3) %>% ggplot(aes(x = carat)) + geom_histogram(binwidth = 0.5) diamonds %>% ggplot(aes(x =...
285 sym R (1892 sym/19 pcs) 15 img
Code Along 5: Updated
Import data # excel file beesdata <- read_excel("../03_module6/beesdata.xlsx") beesdata ## # A tibble: 1,222 × 10 ## year months state colony_n colony_max colony_lost colony_lost_pct ## <dbl> <chr> <chr> <dbl> <chr> <dbl> <dbl> ## 1 2015 January-March Alabama 7000 7000 ...
167 sym Python (5609 sym/14 pcs)
Apply 5 - Jason Zink
Import data # csv file jobs_gender <- readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-03-05/jobs_gender.csv") Apply the following dplyr verbs to your data Filter rows filter(jobs_gender, year == 1, total_workers == 1) Arrange rows arrange(jobs_gender, desc(year), desc(total_workers)) Select c...
160 sym Python (1109 sym/7 pcs)
Code Along 5
##Explore data library(tidyverse) ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.3 ✔ readr 2.1.4 ## ✔ forcats 1.0.0 ✔ stringr 1.5.0 ## ✔ ggplot2 3.4.3 ✔ tibble 3.2.1 ## ✔ lubridate 1.9.2 ✔ tidy...
1226 sym R (7242 sym/31 pcs) 8 img
Week 7: Real World Applications 6
Survey of Professional Forecasters The author writes on page 31: "At the beginning of 2001, the economy was not in recession. The fourth quarter of 2000 data had not been released but would, in time, show that the economy had grown by 2.2 percent in twelve months. Forecasters were nervous, however. The consensus forecast published by the Federal Re...
1170 sym Python (794 sym/1 pcs) 1 tbl
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("AAPL", "BA", "DIS", "NKE") prices <- tq_get(x = symbols, get = "stock.prices", f...
573 sym R (2567 sym/10 pcs) 3 img
Code Along 5
# Load packages # Core library(tidyverse) library(tidyquant) Goal Collect individual returns into a portfolio by assigning a weight to each stock five stocks: “AAPL”, “NVDA”, “ADBE”, “AVGO”, “AMD” from 2012-12-31 to 2017-12-31 1 Import stock prices # Choose stocks symbols <- c("AAPL", "NVDA", "ADBE", "AVGO", "AMD") # ...
538 sym R (2852 sym/10 pcs) 3 img
Apply-5
# 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 # Choose stocks symbols <- c("AMZN", "AAPL", "TSLA", "SPY", "EFA") # Using tq_get() ---- prices <- tq_get(x = symbols, ...
516 sym R (2760 sym/10 pcs) 3 img