DAUPSA : Domestic car production

indicator <-fredr_series_observations(series_id = "DAUPSA", 
      observation_start = as.Date("2016-01-01"))
      


tail(indicator[,-2]) %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(2, T, color = "red" ) 
date value
2020-03-01 150.2
2020-04-01 1.7
2020-05-01 46.5
2020-06-01 138.1
2020-07-01 222.0
2020-08-01 214.0
  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 = "thousands of units",
      x = "Monthly", 
      title = "Domestic Automobile Production (DAUPSA)",
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
    theme_economist()

Motor Vehicle Retail Sales: Domestic Autos (DAUTONSA)

indicator <-fredr_series_observations(series_id = "DAUTONSA", 
      observation_start = as.Date("2016-01-01"))
      


tail(indicator[,-2]) %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(2, T, color = "red" ) 
date value
2020-03-01 209
2020-04-01 126
2020-05-01 183
2020-06-01 179
2020-07-01 221
2020-08-01 234
  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 = "Thousands of units",
      x = "Monthly", 
      title = "Retail Sales: Domestic Autos",
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
    theme_economist()

Motor Vehicle Retail Sales: Foreign Autos (FAUTONSA)

indicator <-fredr_series_observations(series_id = "FAUTONSA", 
      observation_start = as.Date("2016-01-01"))
      


tail(indicator[,-2]) %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(2, T, color = "red" ) 
date value
2020-03-01 56
2020-04-01 41
2020-05-01 75
2020-06-01 72
2020-07-01 74
2020-08-01 73
  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 = "Thousands of units",
      x = "Monthly", 
      title = "Retail Sales: Foreign Autos",
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
    theme_economist()

Domestic Auto Inventories (AUINSA)

indicator <-fredr_series_observations(series_id = "AUINSA", 
      observation_start = as.Date("2016-01-01"))
      


tail(indicator[,-2]) %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(2, T, color = "red" ) 
date value
2020-03-01 543
2020-04-01 462
2020-05-01 361
2020-06-01 372
2020-07-01 452
2020-08-01 476
  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 = "Thousands of units",
      x = "Monthly", 
      title = "Domestic Auto Inventories (AUINSA)",
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
    theme_economist()

Motor Vehicle Retail Sales: Heavy Weight Trucks (HTRUCKSNSA)

indicator <-fredr_series_observations(series_id = "HTRUCKSNSA", 
      observation_start = as.Date("2016-01-01"))
      


tail(indicator[,-2]) %>% kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed")) %>%
   column_spec(2, T, color = "red" ) 
date value
2020-03-01 34
2020-04-01 28
2020-05-01 24
2020-06-01 31
2020-07-01 32
2020-08-01 37
  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 = "Thousands of units",
      x = "Monthly", 
      title = "Heavy Weight Truck Sales (HTRUCKSNSA)",
      caption = "Data source: FRED St. Louis Federal Reserve \nIllustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(indicator$date)} through {max(indicator$date)}")) +
    theme_economist()

michigan <-fredr_series_observations(series_id = "SMU26000003133610001",observation_start = as.Date("2018-01-01")) 


# plotting data
ggplot(michigan) + geom_line(mapping = aes(x=date,y=value),  color = "red") +
  labs(x = "Time",y = "Thousands of workers",
      title = "All Employees: Motor Vehicle Manufacturing in Michigan (SMU26000003133610001)", 
      caption = "Illustration by @JoeLongSanDiego",
      subtitle = str_glue("Monthly from {min(michigan$date)} through {max(michigan$date)}"))+
      theme_economist()

#-----------------------------
al <-fredr_series_observations(series_id = "SMU01000003133610001",observation_start = as.Date("2018-01-01")) 


# plotting data
ggplot(al) + geom_line(mapping = aes(x=date,y=value),  color = "red") +
  labs(x = "Time",y = "Thousands of workers",
      title = "All Employees: Motor Vehicle Manufacturing in Alabama (SMU01000003133610001)", 
      caption = "Illustration by @JoeLongSanDiego",
      subtitle = str_glue("Monthly from {min(al$date)} through {max(al$date)}"))+
      theme_economist()

#-----------------------------
ky <-fredr_series_observations(series_id = "SMU21000003133610001",observation_start = as.Date("2018-01-01")) 


# plotting data
ggplot(ky) + geom_line(mapping = aes(x=date,y=value),  color = "red") +
  labs(x = "Time",y = "Thousands of workers",
      title = "All Employees: Motor Vehicle Manufacturing in Kentucky (SMU21000003133610001)", 
      caption = "Illustration by @JoeLongSanDiego",
      subtitle = str_glue("Monthly from {min(ky$date)} through {max(ky$date)}"))+
      theme_economist()

# Texas = SMU48000003133610001
tx <-fredr_series_observations(series_id = "SMU48000003133610001",observation_start = as.Date("2018-01-01")) 


# plotting data
ggplot(tx) + geom_line(mapping = aes(x=date,y=value),  color = "red") +
  labs(x = "Time",y = "Thousands of workers",
      title = "All Employees: Motor Vehicle Manufacturing in Texas (SMU48000003133610001)", 
      caption = "Illustration by @JoeLongSanDiego",
      subtitle = str_glue("Monthly from {min(tx$date)} through {max(tx$date)}"))+
      theme_economist()

# California =  SMU06000003133610001
ca <-fredr_series_observations(series_id = "SMU06000003133610001",observation_start = as.Date("2018-01-01")) 


# plotting data
ggplot(ca) + geom_line(mapping = aes(x=date,y=value),  color = "red") +
  labs(x = "Time",y = "Thousands of workers",
      title = "All Employees: Motor Vehicle Manufacturing in Califoria (SMU06000003133610001)", 
      caption = "Illustration by @JoeLongSanDiego",
      subtitle = str_glue("Monthly from {min(ca$date)} through {max(ca$date)}"))+
      theme_economist()

# Ohio = SMU39000003133610001

oh <-fredr_series_observations(series_id = "SMU39000003133610001",observation_start = as.Date("2018-01-01")) 


# plotting data
ggplot(oh) + geom_line(mapping = aes(x=date,y=value),  color = "red") +
  labs(x = "Time",y = "Thousands of workers",
      title = "All Employees: Motor Vehicle Manufacturing in Ohio (SMU39000003133610001)", 
      caption = "Illustration by @JoeLongSanDiego",
      subtitle = str_glue("Monthly from {min(oh$date)} through {max(oh$date)}"))+
      theme_economist()

# Missouri = SMU29000003133610001


mo <-fredr_series_observations(series_id = "SMU29000003133610001",observation_start = as.Date("2018-01-01")) 


# plotting data
ggplot(mo) + geom_line(mapping = aes(x=date,y=value),  color = "red") +
  labs(x = "Time",y = "Thousands of workers",
      title = "All Employees: Motor Vehicle Manufacturing in Missouri (SMU29000003133610001)", 
      caption = "Illustration by @JoeLongSanDiego",
      subtitle = str_glue("Monthly from {min(mo$date)} through {max(mo$date)}"))+
      theme_economist()

#-------------------

all <- oh
colnames(all)[3] <-"Ohio"
all$Texas <- tx$value
all$California <- ca$value
all$Kentucky <- ky$value
all$Alabama <- al$value
all$Missouri <- mo$value

Domestic sales of imported new cars, seasonally adjusted and in billions of USD (B149RC1Q027SBEA)

import <-fredr_series_observations(series_id = "B149RC1Q027SBEA",observation_start = as.Date("2018-01-01")) 


# plotting data
ggplot(import) + geom_line(mapping = aes(x=date,y=value),  color = "red") +
  labs(x = "Time",y = "Billions of Dollars",
      title = "Domestic sales of imported new cars", caption = "Illustration by @JoeLongSanDiego",
      subtitle = str_glue("Monthly from {min(import$date)} through {max(import$date)}"))+
      theme(plot.title = element_text(color="blue", size=14, face="bold"))

#-------

export <-fredr_series_observations(series_id = "AB63RC1Q027SBEA",observation_start = as.Date("2018-01-01")) 


# plotting data
ggplot(export) + geom_line(mapping = aes(x=date,y=value),  color = "red") +
  labs(x = "Time",y = "monthly cars [thousands of units]",
      title = "Net Export of Domestic Cars", caption = "Illustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(export$date)} through {max(export$date)}"))+
      theme_economist()

Personal consumption expenditures: New autos (A136RC1Q027SBEA)

sale <-fredr_series_observations(series_id = "A136RC1Q027SBEA",
        observation_start = as.Date("2018-01-01")) 

# convert series list to dataframe
sale_df <- do.call(cbind.data.frame, sale)
# plotting data
ggplot(sale_df) + geom_line(mapping = aes(x=date,y=value), 
                              color = "red") +
  ggtitle("Personal Expenditures for New Cars") + 
  
  labs(x = "Quarterly",y = "Billions of Dollars",
      title = "Personal Expenditures for New Cars", caption = "Illustration by @JoeLongSanDiego",
      subtitle = str_glue("From {min(export$date)} through {max(export$date)}"))+
      theme_economist()   

Personal consumption expenditures: Net purchases of used autos (A137RC1Q027SBEA)

used <-fredr_series_observations(series_id = "A137RC1Q027SBEA",
        observation_start = as.Date("2018-01-01")) 

# convert series list to dataframe
used_df <- do.call(cbind.data.frame, used)
# plotting data
ggplot(used_df) + geom_line(mapping = aes(x=date,y=value), 
                              color = "red") +
  ggtitle("Personal Expenditures for Used Cars") + 
  xlab("Quarterly") + 
  ylab("Billions of Dollars")+
  theme_economist()