Nike’s Stock # Load libraries library(tidyquant) library(tidyverse) library(fpp3) With those libraries, I should have what I need. Let me get Nike’s stock from 2015. # Get Nike stock data Nike.Stocks <- tq_get("NKE", from="2015-01-01") Nike.Stocks %>% as_tsibble(index=date) %>% autoplot(adjusted) + labs(y="Adjusted Closing Price", title="NKE since 2015") Now I want to create monthly data. I will the yearmonth type from lubridate. By default, tidyquant uses yearmon which is different. # Create nike returns, need tq_transmute because we are taking daily data and turning it into monthly.
Voter Turnout in Oregon Oregon’s voter turnout data is published by the Oregon Secretary of State’s office. You can find a direct link to the .pdf here. How hard is to recover a .pdf table? Let’s see. I am going to work with tabulizer. library(tabulizer) library(dplyr) The key function for this will be extract_tables; with knowledge of that let’s see if it just automagically works. library(kableExtra) location <- 'https://sos.
The tidyTuesday data for the week of March 4, 2021 represent 247 rows of Superbowl advertisements coded on a few dimensions by fivethirtyeight. The original article uses 233 and there are a few with at least some missing features in the dataset. The idea was to use binary evaluations of patriotic, funny, uses sex, and a host of other characteristics to describe the universe of Super Bowl ads. One thing that stands out is the difference between Budweiser and Bud Light.
As a continuation of the #DuBoisChallenge, this week’s tidyTuesday presents employment by industry, sex, race, and occupation. There is also some scraped data from the self-service tool that generates weekly and hourly earnings data from the CPS. Let’s see what we have. library(tidyverse) library(fpp3) library(magrittr) employed <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-02-23/employed.csv') earn <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-02-23/earn.csv') employed %<>% as_tsibble(index=year, key=c(industry,major_occupation,minor_occupation,race_gender)) Let me try to plot something. employed %>% filter(race_gender=="TOTAL") %>% autoplot(employ_n) + guides(color=FALSE) To be continued….
tidyTuesday-Screenshot tidyTuesday for the week of February 8, 2021 brings data from the US Census and the Urban Institute together to think about income, wealth, and racial inequality in these and other important economic indicators. There is a lot of data that they make available to accompany the nine charts about wealth inequality that they reported here. There is considerable variation in the scope and coverage of the various datasets; I will start by loading the ten datasets.
tl;dr In September of 2018, I began to track email solicitations by the Trump Campaign. I have noticed a striking pattern of increasing fundraising activity that started just after the July 4 weekend but I wanted to verify this over the span of the data. In short, something is up. The Data I will use the wonderful gmailr package to access my gmail. You need a key and an id that the vignette gives guidance on.