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,n=24) %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(1:3, T, color = "blue" ) 
date series_id value
2019-03-01 PCE 14370
2019-04-01 PCE 14443
2019-05-01 PCE 14493
2019-06-01 PCE 14556
2019-07-01 PCE 14612
2019-08-01 PCE 14651
2019-09-01 PCE 14673
2019-10-01 PCE 14728
2019-11-01 PCE 14753
2019-12-01 PCE 14796
2020-01-01 PCE 14880
2020-02-01 PCE 14877
2020-03-01 PCE 13878
2020-04-01 PCE 12112
2020-05-01 PCE 13165
2020-06-01 PCE 14015
2020-07-01 PCE 14225
2020-08-01 PCE 14397
2020-09-01 PCE 14583
2020-10-01 PCE 14627
2020-11-01 PCE 14533
2020-12-01 PCE 14451
2021-01-01 PCE 14939
2021-02-01 PCE 14790
  indicator %>% 
    ggplot(aes(x = date, y = value)) +
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-02-2021'), 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()

Real Personal Consumption Expenditures: Services (PCESC96)

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


tail(indicator,n=24) %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(3, T, color = "red" ) 
date series_id value
2019-03-01 PCESC96 8480
2019-04-01 PCESC96 8484
2019-05-01 PCESC96 8494
2019-06-01 PCESC96 8517
2019-07-01 PCESC96 8527
2019-08-01 PCESC96 8540
2019-09-01 PCESC96 8557
2019-10-01 PCESC96 8575
2019-11-01 PCESC96 8587
2019-12-01 PCESC96 8593
2020-01-01 PCESC96 8624
2020-02-01 PCESC96 8625
2020-03-01 PCESC96 7847
2020-04-01 PCESC96 6894
2020-05-01 PCESC96 7291
2020-06-01 PCESC96 7736
2020-07-01 PCESC96 7838
2020-08-01 PCESC96 7926
2020-09-01 PCESC96 7995
2020-10-01 PCESC96 8029
2020-11-01 PCESC96 8001
2020-12-01 PCESC96 7978
2021-01-01 PCESC96 8034
2021-02-01 PCESC96 8022
  indicator %>% 
    ggplot(aes(x = date, y = value)) +
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-02-2021'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    geom_line(color = "red4",size=.8) + 
    labs(
      y = "Billions of Dollars",
      x = "Monthly", 
      title = "Real Personal Consumption Expenditures: Services (PCESC96)",
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
    theme_economist()

Real personal consumption expenditures: Food (DFXARX1M020SBEA)

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


tail(indicator,n=24) %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(3, T, color = "red" ) 
date series_id value
2019-03-01 DFXARX1M020SBEA 971
2019-04-01 DFXARX1M020SBEA 978
2019-05-01 DFXARX1M020SBEA 978
2019-06-01 DFXARX1M020SBEA 984
2019-07-01 DFXARX1M020SBEA 994
2019-08-01 DFXARX1M020SBEA 995
2019-09-01 DFXARX1M020SBEA 986
2019-10-01 DFXARX1M020SBEA 987
2019-11-01 DFXARX1M020SBEA 987
2019-12-01 DFXARX1M020SBEA 987
2020-01-01 DFXARX1M020SBEA 985
2020-02-01 DFXARX1M020SBEA 981
2020-03-01 DFXARX1M020SBEA 1202
2020-04-01 DFXARX1M020SBEA 1028
2020-05-01 DFXARX1M020SBEA 1051
2020-06-01 DFXARX1M020SBEA 1044
2020-07-01 DFXARX1M020SBEA 1058
2020-08-01 DFXARX1M020SBEA 1050
2020-09-01 DFXARX1M020SBEA 1057
2020-10-01 DFXARX1M020SBEA 1048
2020-11-01 DFXARX1M020SBEA 1061
2020-12-01 DFXARX1M020SBEA 1036
2021-01-01 DFXARX1M020SBEA 1098
2021-02-01 DFXARX1M020SBEA 1079
  indicator %>% 
    ggplot(aes(x = date, y = value)) +
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-02-2021'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    geom_line(color = "red4",size=.8) + 
    labs(
      y = "Billions of Chained 2012 Dollars",
      x = "Monthly", 
      title = "Real personal consumption expenditures: Food (DFXARX1M020SBEA)",
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
    theme_economist()

Real Personal Consumption Expenditures: Durable Goods (PCEDGC96)

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


tail(indicator[,c(1,3)],n=24) %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(1:2, T, color = "blue" ) 
date value
2019-03-01 1749
2019-04-01 1756
2019-05-01 1777
2019-06-01 1779
2019-07-01 1788
2019-08-01 1797
2019-09-01 1808
2019-10-01 1801
2019-11-01 1813
2019-12-01 1820
2020-01-01 1835
2020-02-01 1814
2020-03-01 1607
2020-04-01 1427
2020-05-01 1831
2020-06-01 1975
2020-07-01 2006
2020-08-01 2030
2020-09-01 2048
2020-10-01 2067
2020-11-01 2025
2020-12-01 1976
2021-01-01 2209
2021-02-01 2107
  indicator %>% 
    ggplot(aes(x = date, y = value)) +
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-02-2021'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    geom_line(color = "red4",size=.8) + 
    labs(
      y = "Billions of Chained 2012 Dollars",
      x = "Monthly", 
      title = "Real Personal Consumption Expenditures: Durable Goods (PCEDGC96)",
      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-09-01 A063RC1 4052
2020-10-01 A063RC1 3809
2020-11-01 A063RC1 3679
2020-12-01 A063RC1 3749
2021-01-01 A063RC1 5731
2021-02-01 A063RC1 4147
  indicator %>% 
    ggplot(aes(x = date, y = value)) +
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-02-2021'), 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 = "2015-01-01") %>%
   rename(count = price) 

  labor %>% 
    ggplot(aes(x = date, y = count)) +
    geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-02-2021'), 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-02-2021'), 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-09-01 DFXARC1M027SBEA 1146
2020-10-01 DFXARC1M027SBEA 1139
2020-11-01 DFXARC1M027SBEA 1151
2020-12-01 DFXARC1M027SBEA 1126
2021-01-01 DFXARC1M027SBEA 1192
2021-02-01 DFXARC1M027SBEA 1174
  indicator %>% 
    ggplot(aes(x = date, y = value)) +
     geom_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-02-2021'), 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_rect(aes(xmin= dmy('01-01-2020'), xmax=dmy('01-02-2021'), ymin = -Inf, ymax = Inf),
                   fill = "lightyellow", alpha = 0.02)+
    geom_line(color = "gold4",size=.8) + 
    
    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_economist()+
    theme(plot.title = element_text(color="blue", size=15, 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_economist()+
    theme(legend.position="top", plot.title = element_text(hjust = 0.5))