Publications by Daniel Lee
Apply 5
Import data # excel file beesdata <- read_excel("../03_module6/beesdata.xlsx") beesdata Apply the following dplyr verbs to your data Filter rows filter(beesdata, year == 2013, state == "New Hampshire") Arrange rows arrange(beesdata, desc(colony_lost_pct), desc(year)) Select columns select(beesdata, year, months, state, colony_lost) select(be...
159 sym Python (534 sym/6 pcs)
apply4new
Import data # excel file data <- read_excel("../02_module5/beesdata.xlsx") data State one question Do larger total colonies lose more percentage of colonies than smaller total colonies? (Hypothesis) Larger colonies will lose a larger percentage of colonies. Plot data ggplot(data = data) + geom_smooth(mapping = aes(x = colony_n, y = colo...
989 sym 3 img
CodeAlong-5
… title: “Week 6: Code along 5” subtitle: “CHAPTER 3 Building a Portfolio” author: “Luka Prestia” date: “2023-10-02” output: html_document editor_options: chunk_output_type: console — # Load packages # Core library(tidyverse) library(tidyquant) Goal Collect individual returns into a portfolio by assigning a weight to each stoc...
483 sym R (2513 sym/10 pcs) 3 img
Code Along 5 Chapter 5 - Jason Zink
Import data flights ## # A tibble: 336,776 × 19 ## year month day dep_time sched_de…¹ dep_d…² arr_t…³ sched…⁴ arr_d…⁵ carrier ## <int> <int> <int> <int> <int> <dbl> <int> <int> <dbl> <chr> ## 1 2013 1 1 517 515 2 830 819 11 UA ## 2 2013 1 1 533...
528 sym Python (21937 sym/56 pcs) 1 img
Code Along 5 Chapter 4 - Jason Zink
Coding basics R as a calculator 1000 / 10 ## [1] 100 x <- 1000 / 10 # x assignment symbol What’s in a name? Calling functions Use of TAB seq(from = 1, to = 10, by = 1) ## [1] 1 2 3 4 5 6 7 8 9 10 continuation character, + seq(from = 1, to = 10) ## [1] 1 2 3 4 5 6 7 8 9 10 Printing to screen y <- seq(from = 1, to = 10) y...
171 sym Python (229 sym/9 pcs)
CA4
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 ✔ tidyr ...
1427 sym R (8446 sym/28 pcs) 4 img
Code along5
# 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, ...
299 sym R (2362 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: “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_ge...
300 sym R (2574 sym/10 pcs) 3 img
CodeAlong5Ch5
Import data flights ## # A tibble: 336,776 × 19 ## year month day dep_time sched_dep_time dep_delay arr_time sched_arr_time ## <int> <int> <int> <int> <int> <dbl> <int> <int> ## 1 2013 1 1 517 515 2 830 819 ## 2 2013 1 1 533 529 ...
527 sym Python (20298 sym/53 pcs) 1 img