Consumer Sentiment as general trends.

senti <- 
  "UMCSENT" %>% 
  tq_get(get = "economic.data", from = "2015-01-01") %>%
  rename(count = price) 

  senti %>% 
    ggplot(aes(x = date, y = count)) +
    geom_line(color = "firebrick2",size=.8) + 
    labs(
      x = "",
      y = "",
      title = "Consumer Sentiment Index per University of Michigan",
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("Monthly from {min(senti$date)} through {max(senti$date)}")
    ) +
    theme_economist()

indicator <-fredr_series_observations(series_id = "PCE", 
      observation_start = as.Date("2017-01-01"))
      


tail(indicator) %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(2, T, color = "red" ) 
date series_id value
2020-03-01 PCE 13878
2020-04-01 PCE 12112
2020-05-01 PCE 13165
2020-06-01 PCE 14015
2020-07-01 PCE 14228
2020-08-01 PCE 14370
  indicator %>% 
    ggplot(aes(x = date, y = value)) +
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-09-2020'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    geom_line(color = "red4",size=.8) + 
    labs(
      y = "Billions of Dollars",
      x = "Monthly", 
      title = "Personal Consumption Expenditures (PCE)",
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
    theme_economist()

## Personal Income (PI)

indicator <-fredr_series_observations(series_id = "PI", 
      observation_start = as.Date("2017-01-01"))
      


tail(indicator) %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(2, T, color = "red" ) 
date series_id value
2020-03-01 PI 18764
2020-04-01 PI 21062
2020-05-01 PI 20184
2020-06-01 PI 19944
2020-07-01 PI 20036
2020-08-01 PI 19493
  indicator %>% 
    ggplot(aes(x = date, y = value)) +
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-09-2020'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    geom_line(color = "red4",size=.8) + 
    labs(
      y = "Billions of Dollars",
      x = "Monthly", 
      title = "Personal Income (PI)",
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
    theme_economist()

Personal current transfer receipts: Government social benefits to persons (A063RC1)

indicator <-fredr_series_observations(series_id = "A063RC1", 
      observation_start = as.Date("2017-01-01"))
      


tail(indicator) %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(2, T, color = "red" ) 
date series_id value
2020-03-01 A063RC1 3246
2020-04-01 A063RC1 6552
2020-05-01 A063RC1 5432
2020-06-01 A063RC1 4898
2020-07-01 A063RC1 4850
2020-08-01 A063RC1 4124
  indicator %>% 
    ggplot(aes(x = date, y = value)) +
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-09-2020'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    geom_line(color = "red4",size=.8) + 
    labs(
      y = "Billions of Dollars",
      x = "Monthly", 
      title = "Government social benefits to persons ",
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
    theme_economist()

Employment during COVID19 pandemic

labor <- 
  "PAYEMS" %>% 
  tq_get(get = "economic.data", from = "2017-01-01") %>%
   rename(count = price) 

  labor %>% 
    ggplot(aes(x = date, y = count)) +
    geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-09-2020'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    geom_line(color = "firebrick4",size=.8) + 
    labs(
      x = "",
      y = "",
      title = "Total Labor Force",   
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(labor$date)} through {max(labor$date)}")
    ) +
  
     theme_economist()

Total Unemployed (U6RATE)

u6 <- 
  "U6RATE" %>% 
  tq_get(get = "economic.data", from = "2019-01-01") %>%
   rename(count = price) 

  u6 %>% 
    ggplot(aes(x = date, y = count)) +
    geom_line(color = "blue",size=1.2) + 
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-09-2020'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    labs(
      x = "",
      y = "Percent",
      title = "Total Unemployed Rate (U6Rate)", 
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(u6$date)} through {max(u6$date)}")
    ) +
  
     theme_economist()

Personal consumption expenditures: Food (DFXARC1M027SBEA)

indicator <-fredr_series_observations(series_id = "DFXARC1M027SBEA", 
      observation_start = as.Date("2017-01-01"))
      


tail(indicator) %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(2, T, color = "red" ) 
date series_id value
2020-03-01 DFXARC1M027SBEA 1273
2020-04-01 DFXARC1M027SBEA 1115
2020-05-01 DFXARC1M027SBEA 1149
2020-06-01 DFXARC1M027SBEA 1147
2020-07-01 DFXARC1M027SBEA 1150
2020-08-01 DFXARC1M027SBEA 1140
  indicator %>% 
    ggplot(aes(x = date, y = value)) +
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-09-2020'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    geom_line(color = "red4",size=.8) + 
    labs(
      y = "Billions of Dollars",
      x = "Monthly", 
      title = "Personal consumption expenditures: Food",
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
    theme_economist()

Consumer Price Index for All Urban Consumers: Meats, Poultry, Fish, and Eggs in U.S. City Average (CUSR0000SAF112)

mpfe <- 
  "CUSR0000SAF112" %>% 
  tq_get(get = "economic.data", from = "2019-01-01") 

  mpfe %>% 
    ggplot(aes(x = date, y = price)) +
    geom_line(color = "gold4",size=.8) + 
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-09-2020'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    labs(
      x = "",
      y = "Index 1982-1984=100", 
      caption = "Index 1982-1984=100,Seasonally Adjusted\n
      Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      title = "CPI : Meats, Poultry, Fish, and Eggs (CUSR0000SAF112)",
      subtitle = str_glue("From {min(mpfe$date)} through {max(mpfe$date)}")
    ) +
  
     theme_economist()

cpi <- 
  "CPIAUCSL" %>% 
  tq_get(get = "economic.data", from = "2019-01-01") %>%
  rename(count = price) 

  cpi %>% 
    ggplot(aes(x = date, y = count)) +
    geom_line(color = "goldenrod4",size=.8) + 
    labs(
      x = "",
      y = "", caption = "Index 1982-1984=100,Seasonally Adjusted",
      title = "Consumer Price Index: All Items in U.S. City Average (CPIAUCSL)",
      subtitle = str_glue("Monthly from {min(cpi$date)} through {max(cpi$date)}")
    ) +
    theme(plot.title = element_text(color="blue", size=14, face="bold"))

Consumer Price Index for All Urban Consumers: Food at Home in U.S. City Average (CUSR0000SAF11)

food <- 
  "CUSR0000SAF11" %>% 
  tq_get(get = "economic.data", from = "2019-01-01") %>%
  rename(count = price) 

  food %>% 
    ggplot(aes(x = date, y = count)) +
    geom_line(color = "goldenrod4",size=.8) + 
    labs(
      x = "",
      y = "", caption = "Index 1982-1984=100,Seasonally Adjusted",
      title = "CPI: Food at Home in U.S. City Average (CUSR0000SAF11)",
      subtitle = str_glue("Monthly from {min(food$date)} through {max(food$date)}")
    ) +
    theme(plot.title = element_text(color="blue", size=14, face="bold"))

CPI Average Price Data, U.S. city average (AP) (Select from list below) Bacon, sliced, per lb. - APU0000704111 Bananas, per lb. - APU0000711211 Bread, white, pan, per lb. - APU0000702111 Chicken, fresh, whole, per lb. - APU0000706111 Coffee, 100%, ground roast, all sizes, per lb. - APU0000717311 Eggs, grade A, large, per doz. - APU0000708111 Flour, white, all purpose, per lb. - APU0000701111 Milk, fresh, whole, fortified, per gal. - APU0000709112 Oranges, navel, per lb. - APU0000711311 Rice, white, long grain, uncooked, per lb. - APU0000701312 Tomatoes, field grown, per lb. - APU0000712311 Electricity per KWH - APU000072610 Fuel oil #2 per gallon - APU000072511 Gasoline, all types, per gallon - APU00007471A Gasoline, unleaded regular, per gallon - APU000074714

library(blscrapeR)
library(tidyverse)

df <- bls_api(c("APU0000704111", "APU0000706111","APU0000708111","APU0000709112"), 
              startyear = 2019, endyear = 2020)  %>%
    spread(seriesID, value) %>% dateCast() %>%
   rename(chicken=APU0000706111,egg=APU0000708111,beacon=APU0000704111,milk=APU0000709112)
## REQUEST_SUCCEEDED
ggplot(data = df, aes(x = date)) + 
    geom_line(aes(y = chicken, color = "chicken"),size=.8) +
    geom_line(aes(y = egg, color = "egg"),size=.8) + 
    geom_line(aes(y = beacon, color = "beacon"),size=.8) +
    geom_line(aes(y = milk, color = "milk"),size=.8) +
    labs(title = "Food Prices During COVID19 Pandemic", y="Price", x="Date") +
    theme(legend.position="top", plot.title = element_text(hjust = 0.5))