library(tigris)
## To enable
## caching of data, set `options(tigris_use_cache = TRUE)` in your R script or .Rprofile.
##
## Attaching package: 'tigris'
## The following object is masked from 'package:graphics':
##
## plot
library(rvest)
## Loading required package: xml2
##
## Attaching package: 'rvest'
## The following object is masked from 'package:purrr':
##
## pluck
## The following object is masked from 'package:readr':
##
## guess_encoding
library(leaflet)
##
## Attaching package: 'leaflet'
## The following object is masked from 'package:xts':
##
## addLegend
library(dplyr)
library(stringr)
oil <-fredr_series_observations(series_id = "SMU48000001021100001",
observation_start = as.Date("2019-01-01"))
# plotting data
ggplot(oil) + geom_line(mapping = aes(x=date,y=value),
color = "red4") +
labs(title = "Employees: Oil and Gas Extraction in Texas",
subtitle = str_glue("Monthly from {min(oil$date)} through {max(oil$date)}"),
x="Monthly", y="Thousands of workers",caption = "Illustration by @JoeLongSanDiego")+
theme_economist()
## All Employees: Oil and Gas Extraction in Houston-The Woodlands-Sugar Land, TX (MSA) (SMU48264201021100001)
oil <-fredr_series_observations(series_id = "SMU48264201021100001",
observation_start = as.Date("2019-01-01"))
# plotting data
ggplot(oil) + geom_line(mapping = aes(x=date,y=value),
color = "blue4") +
labs(title = "Employees in Oil and Gas Extraction in Houston Metropolitan",
subtitle =str_glue("Monthly from {min(oil$date)} through {max(oil$date)}"),
x="Monthly", y="Thousands of workers",caption = "Illustration by @JoeLongSanDiego")+
theme_economist()+
scale_color_economist()
## Civilian Labor Force in Houston-The Woodlands-Sugar Land, TX (MSA) (HOUS448LFN)
labor <-fredr_series_observations(series_id = "HOUS448LFN",
observation_start = as.Date("2019-01-01"))
# plotting data
ggplot(labor) + geom_line(mapping = aes(x=date,y=value),
color = "brown4") +
labs(title = "Civilian Labor Force in Houston Metropolitan, TX",
subtitle = str_glue("Monthly from {min(labor$date)} through {max(labor$date)}"),
x="Monthly", y="Thousands of workers",caption = "Illustration by @JoeLongSanDiego")+
theme_economist()+
scale_color_economist()
## All Employees: Manufacturing in Texas (TXMFGN) * Thousands of Persons, Not Seasonally Adjusted
manufacturing <-fredr_series_observations(series_id = "TXMFGN", observation_start = as.Date("2019-01-01"))
# plotting data
ggplot(manufacturing) + geom_line(mapping = aes(x=date,y=value),
color = "green4") +
labs(title = "All Employees: Manufacturing in Texas (TXMFG)",
subtitle = str_glue("Monthly from {min(manufacturing$date)} through {max(manufacturing$date)}"),
x="Monthly", y="Thousands of workers",caption = "Illustration by @JoeLongSanDiego")+
theme_economist()
retail <-fredr_series_observations(series_id = "SMS48000004200000001",
observation_start = as.Date("2019-01-01"))
# plotting data
ggplot(retail) + geom_line(mapping = aes(x=date,y=value),
color = "goldenrod4") +
labs(title = "All Employees: Retail Trade in Texas",
subtitle = str_glue("Monthly from {min(retail$date)} through {max(retail$date)}",
x="Monthly", y="Thousands of workers",caption = "Illustration by @JoeLongSanDiego"))+
theme_economist()
car <-fredr_series_observations(series_id = "SMU48000003133610001",
observation_start = as.Date("2019-01-01"))
# plotting data
ggplot(car) + geom_line(mapping = aes(x=date,y=value), color = "gold4") +
labs(title = "All Employees: Car Manufacturing in Texas",
x="Monthly", y="Thousands of workers",caption = "Illustration by @JoeLongSanDiego",
subtitle = str_glue("Monthly from {min(car$date)} through {max(car$date)}"))+
theme_economist()
indicator <-fredr_series_observations(series_id = "SMU48000003133440001",
observation_start = as.Date("2019-01-01"))
# plotting data
ggplot(indicator) + geom_line(mapping = aes(x=date,y=value), color = "gold4") +
labs(title = "All Employees: Semiconductor & Electronic Manufacturing in Texas",
x="Monthly", y="Thousands of workers",caption = "Illustration by @JoeLongSanDiego",
subtitle = str_glue("Monthly from {min(indicator$date)} through {max(indicator$date)}"))+
theme_economist()
## M2V * M1 is defined by the Federal Reserve as the sum of all currency held by the public and transaction deposits at depository institutions. * M2 is a broader measure of money supply, adding in savings deposits, time deposits, and real money market mutual funds.
indicator <-fredr_series_observations(series_id = "M2V",
observation_start = as.Date("1960-01-01"))
# plotting data
ggplot(indicator) + geom_line(mapping = aes(x=date,y=value), color = "brown4") +
labs(title = "M2 Velocity Since 1960",
x="Quarterly", y="Ratio",caption = "Illustration by @JoeLongSanDiego",
subtitle = str_glue("Monthly from {min(indicator$date)} through {max(indicator$date)}"))+
theme_economist()