National Unemployment Rate (UNRATE)

usa_claims <- 
  "UNRATE" %>% 
  tq_get(get = "economic.data", 
         from = "2019-01-01") %>% 
  rename(claims = price) 


  usa_claims %>% 
    ggplot(aes(x = date, y = claims)) +
    geom_line(color = "blue",size=1) + 
    labs(
      x = "",
      y = "",
      title = "New Unemployment Claims _ National",
      subtitle = str_glue("Weekly from {min(usa_claims$date)} through {max(usa_claims$date)}")
    ) +
    theme_economist() +
    scale_y_continuous(labels = scales::comma)

California Unemployment

ca_claims <- 
  "CAICLAIMS" %>% 
  tq_get(get = "economic.data", 
         from = "2019-01-01") %>% 
  rename(claims = price) 


  ca_claims %>% 
    ggplot(aes(x = date, y = claims)) +
    geom_line(color = "blue",size=1) + 
    labs(
      x = "",
      y = "",
      title = "New Unemployment Claims _ California",
      subtitle = str_glue("Weekly from {min(ca_claims$date)} through {max(ca_claims$date)}")
    ) +
    theme_economist() +
    scale_y_continuous(labels = scales::comma)

ca_claims<- ca_claims %>%
  mutate(
    year = year(date),
    month =  month(date, label = T, abbr  = T),
    week = week(date))
    
ca_month <- ca_claims %>%
             group_by(year,month)%>%
             summarise(Ave_count =sum(claims))
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
  ggplot(data=ca_claims,aes(x=date,y = claims,fill=month)) +
  geom_bar(stat = "identity")+
  labs(
    title = "Weekly Unemployment Claims in California",
    subtitle = str_glue("{min(ca_claims$date)} through {max(ca_claims$date)}"),
    caption = "Illustration by Joe Long", y = "", x = "") 

  ggplot(data=ca_month,aes(x=reorder(month,year),y = Ave_count,fill=month)) +
  geom_bar(stat = "identity")+
  labs(    title = "Monthly Count of New Unemployment Claims in California",
    subtitle = "",  caption = "Illustration by Joe Long", y = "", x = "") 

ca_month %>%
  kable() %>%
  kable_styling()  
year month Ave_count
2019 Jan 197785
2019 Feb 171719
2019 Mar 201469
2019 Apr 159868
2019 May 153713
2019 Jun 201622
2019 Jul 152034
2019 Aug 181829
2019 Sep 133808
2019 Oct 153780
2019 Nov 211487
2019 Dec 180199
2020 Jan 199167
2020 Feb 203952
2020 Mar 1345649
2020 Apr 2427989
2020 May 1205251
2020 Jun 1059116
2020 Jul 839299
par(mfrow=c(2,1))

sdurn <- 
  "CASAND5URN" %>% 
  tq_get(get = "economic.data", 
         from = "2019-01-01") %>% 
  rename(claims = price) 


  sdurn %>% 
    ggplot(aes(x = date, y = claims)) +
    geom_line(color = "blue",size=1) + 
    labs(
      x = "",
      y = "",
      title = "Unemployment Rate _ San Diego (CASAND5URN)",
      subtitle = str_glue("From {min(sdurn$date)} through {max(sdurn$date)}")
    ) +
    theme_fivethirtyeight() +
    scale_y_continuous(labels = scales::comma)

sdun <- 
  "LAUCN060730000000004" %>% 
  tq_get(get = "economic.data", 
         from = "2019-01-01") %>% 
  rename(claims = price) 


  sdun %>% 
    ggplot(aes(x = date, y = claims)) +
    geom_line(color = "blue",size=1) + 
    labs(
      x = "",
      y = "",
      title = "Unemployment Population _ San Diego (LAUCN060730000000004)",
      subtitle = str_glue("From {min(sdun$date)} through {max(sdun$date)}")
    ) +
    theme_fivethirtyeight() +
    scale_y_continuous(labels = scales::comma)

sdlabor <- 
  "CASAND5LFN" %>% 
  tq_get(get = "economic.data", 
         from = "2019-01-01") %>% 
  rename(claims = price) 


  sdlabor %>% 
    ggplot(aes(x = date, y = claims)) +
    geom_line(color = "blue",size=1) + 
    labs(
      x = "",
      y = "",
      title = "Civilian Labor Force in San Diego County, CA (CASAND5LFN)",
      subtitle = str_glue("From {min(sdlabor$date)} through {max(sdlabor$date)}")
    ) +
     theme_fivethirtyeight() +
    scale_y_continuous(labels = scales::comma)    

rsurn <- 
  "CARIVE5URN" %>% 
  tq_get(get = "economic.data", 
         from = "2019-01-01") %>% 
  rename(claims = price) 


  rsurn %>% 
    ggplot(aes(x = date, y = claims)) +
    geom_line(color = "darkgreen",size=1) + 
    labs(
      x = "",
      y = "",
      title = "Unemployment Rate _ Riverside County (CARIVE5URN)",
      subtitle = str_glue("From {min(rsurn$date)} through {max(rsurn$date)}")
    ) +
    theme_hc()+
    scale_y_continuous(labels = scales::comma)

rsun <- 
  "LAUCN060650000000004" %>% 
  tq_get(get = "economic.data", 
         from = "2019-01-01") %>% 
  rename(claims = price) 


  rsun %>% 
    ggplot(aes(x = date, y = claims)) +
    geom_line(color = "darkgreen",size=1) + 
    labs(
      x = "",
      y = "",
      title = "Unemployment Population _ Riverside County (LAUCN060650000000004)",
      subtitle = str_glue("From {min(rsun$date)} through {max(rsun$date)}")
    ) +
     theme_hc()+
    scale_y_continuous(labels = scales::comma)    

#---------------------
rslabor <- 
  "CARIVE5LFN" %>% 
  tq_get(get = "economic.data", 
         from = "2019-01-01") %>% 
  rename(claims = price) 


  rslabor %>% 
    ggplot(aes(x = date, y = claims)) +
    geom_line(color = "darkgreen",size=1) + 
    labs(
      x = "",
      y = "",
      title = "Civilian Labor Force in Riverside County, CA (CARIVE5LFN)",
      subtitle = str_glue("From {min(rslabor$date)} through {max(rslabor$date)}")
    ) +
    theme_hc()+
    scale_y_continuous(labels = scales::comma)    

* Unemployment Rate in Orange County, CA (CAORAN7URN) * Unemployed Persons in Orange County, CA (LAUCN060590000000004) * Civilian Labor Force in Orange County, CA (CAORAN7LFN)

ocurn <- 
  "CAORAN7URN" %>% 
  tq_get(get = "economic.data", 
         from = "2019-01-01") %>% 
  rename(claims = price) 


  ocurn %>% 
    ggplot(aes(x = date, y = claims)) +
    geom_line(color = "blue",size=1) + 
    labs(
      x = "",
      y = "",
      title = "Unemployment Rate _ Orange County (CAORAN7URN)",
      subtitle = str_glue("From {min(ocurn$date)} through {max(ocurn$date)}")
    ) +
    theme_classic()+
    scale_y_continuous(labels = scales::comma)

#--------------------------------  
ocun <- 
  "LAUCN060590000000004" %>% 
  tq_get(get = "economic.data", 
         from = "2019-01-01") %>% 
  rename(claims = price) 


  ocun %>% 
    ggplot(aes(x = date, y = claims)) +
    geom_line(color = "blue",size=1) + 
    labs(
      x = "",
      y = "",
      title = "Unemployment Population _ Orange County (LAUCN060590000000004)",
      subtitle = str_glue("From {min(ocun$date)} through {max(ocun$date)}")
    ) +
     theme_classic()+
    scale_y_continuous(labels = scales::comma)  

  #------------------------
oclabor <- 
  "CAORAN7LFN" %>% 
  tq_get(get = "economic.data", 
         from = "2019-01-01") %>% 
  rename(claims = price) 


  oclabor %>% 
    ggplot(aes(x = date, y = claims)) +
    geom_line(color = "blue",size=1) + 
    labs(
      x = "",
      y = "",
      title = "Civilian Labor Force in Orange County, CA (CAORAN7LFN)",
      subtitle = str_glue("From {min(oclabor$date)} through {max(oclabor$date)}")
    ) +
    theme_classic()+
    scale_y_continuous(labels = scales::comma)    

laurn <- 
  "CALOSA7URN" %>% 
  tq_get(get = "economic.data", 
         from = "2019-01-01") %>% 
  rename(claims = price) 


  laurn %>% 
    ggplot(aes(x = date, y = claims)) +
    geom_line(color = "darkblue",size=1) + 
    labs(
      x = "",
      y = "",
      title = "Unemployment Rate _ Los Angeles County (CALOSA7URN)",
      subtitle = str_glue("From {min(laurn$date)} through {max(laurn$date)}")
    ) +
    theme_economist_white() +
    scale_y_continuous(labels = scales::comma)

#--------------------------------  
laun <- 
  "LAUCN060370000000004" %>% 
  tq_get(get = "economic.data", 
         from = "2019-01-01") %>% 
  rename(claims = price) 


  laun %>% 
    ggplot(aes(x = date, y = claims)) +
    geom_line(color = "darkblue",size=1) + 
    labs(
      x = "",
      y = "",
      title = "Unemployment Population _ Los Angeles County (LAUCN060370000000004)",
      subtitle = str_glue("From {min(laun$date)} through {max(laun$date)}")
    ) +
    theme_economist_white() +
    scale_y_continuous(labels = scales::comma)  

  #------------------------
lalabor <- 
  "CALOSA7LFN" %>% 
  tq_get(get = "economic.data", 
         from = "2019-01-01") %>% 
  rename(claims = price) 


  oclabor %>% 
    ggplot(aes(x = date, y = claims)) +
    geom_line(color = "blue",size=1) + 
    labs(
      x = "",
      y = "",
      title = "Civilian Labor Force in Los Angeles County, CA (CALOSA7LFN)",
      subtitle = str_glue("From {min(lalabor$date)} through {max(lalabor$date)}")
    ) +
    theme_economist_white() +
    scale_y_continuous(labels = scales::comma)