Publications by Tucker Moore
CodeAlong3
# load packages library(tidyverse) ## Warning: package 'tidyverse' was built under R version 4.3.3 ## Warning: package 'forcats' was built under R version 4.3.3 ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.4 ✔ readr 2.1.5 ...
127 sym R (3408 sym/14 pcs)
CodeAlong4
# Load packages # Core library(tidyverse) ## Warning: package 'tidyverse' was built under R version 4.3.3 ## Warning: package 'forcats' was built under R version 4.3.3 ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.4 ✔ readr ...
222 sym R (4254 sym/13 pcs) 1 img
CodeAlong5
# 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...
342 sym R (2848 sym/16 pcs) 3 img
Document
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 ...
567 sym Python (20593 sym/59 pcs) 1 img
Document
1 Footnotes This is some text with a Footnote1. This is a second Footnote2. 1.1 What can RMarkdown be used for? HTML Reports & PDF Reports HTML Slide Decks & PowerPoint Interactive Dashboards Books with bookdown Websites with blogdown 1.2 Key Resources RMarkdown Website with Gallery Key Reference: RMarkdown - The Definitive Guide PDF...
1209 sym Python (451 sym/6 pcs) 3 img 1 tbl
Document
Welcome Ch1 Introduction The data science project workflow Prerequisites R RStudio r packages Install the tidyverse package Running R code 1+2 ## [1] 3 Getting help Google Stackoverflow Ch2 Introduction to Data Exploration Ch3 Data Visualization Set up library(tidyverse) ## Warning: package 'tidyverse' was built under R version 4.3.3 ## ...
1384 sym R (1971 sym/15 pcs) 8 img
Document
Import stock prices stocks <- tq_get(c("MCD", "META"), get = "stock.prices", from = "2016-01-01", to = "2018-01-01") stocks ## # A tibble: 1,006 × 8 ## symbol date open high low close volume adjusted ## <chr> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> ## 1 MCD ...
50 sym Python (1100 sym/3 pcs) 1 img
Document
Ch20 Vectors 1 Introduction 2 Vector basics 3 Important types of atomic vector 4 Using atomic vectors sample(10) + 10 ## [1] 14 16 17 19 12 13 11 18 20 15 1:10 + 1:2 ## [1] 2 4 4 6 6 8 8 10 10 12 1:10 + 1:3 ## Warning in 1:10 + 1:3: longer object length is not a multiple of shorter object ## length ## [1] 2 4 6 5 7 9 8 10 12 1...
360 sym Python (2238 sym/52 pcs)
Document
Ch15 Factors Creating factors General Social Survey gss_cat ## # A tibble: 21,483 × 9 ## year marital age race rincome partyid relig denom tvhours ## <int> <fct> <int> <fct> <fct> <fct> <fct> <fct> <int> ## 1 2000 Never married 26 White $8000 to 9999 Ind,near … Prot… Sout… 12 ...
395 sym 3 img
Document
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...
293 sym