SP_prices_pre_pandemic <- tq_index("SP500") %>%
  tq_get(get = "stock.prices",
         from = "2019-03-13",
         to = "2020-03-13")
## Getting holdings for SP500
## Warning: x = 'CARR', get = 'stock.prices': Error in getSymbols.yahoo(Symbols = "CARR", env = <environment>, verbose = FALSE, : Unable to import "CARR".
## CARR download failed after two attempts. Error message:
## HTTP error 400.
##  Removing CARR.
## Warning: x = 'OTIS', get = 'stock.prices': Error in getSymbols.yahoo(Symbols = "OTIS", env = <environment>, verbose = FALSE, : Unable to import "OTIS".
## OTIS download failed after two attempts. Error message:
## HTTP error 400.
##  Removing OTIS.
## Warning: x = 'CEG', get = 'stock.prices': Error in getSymbols.yahoo(Symbols = "CEG", env = <environment>, verbose = FALSE, : Unable to import "CEG".
## CEG download failed after two attempts. Error message:
## HTTP error 400.
##  Removing CEG.
## Warning: x = 'OGN', get = 'stock.prices': Error in getSymbols.yahoo(Symbols = "OGN", env = <environment>, verbose = FALSE, : Unable to import "OGN".
## OGN download failed after two attempts. Error message:
## HTTP error 400.
##  Removing OGN.
SP_prices_pre_pandemic
SP_prices_in_pandemic <- tq_index("SP500") %>%
  tq_get(get = "stock.prices",
         from = "2020-03-14",
         to = "2021-03-14")
## Getting holdings for SP500
## Warning: x = 'CEG', get = 'stock.prices': Error in getSymbols.yahoo(Symbols = "CEG", env = <environment>, verbose = FALSE, : Unable to import "CEG".
## CEG download failed after two attempts. Error message:
## HTTP error 400.
##  Removing CEG.
## Warning: x = 'OGN', get = 'stock.prices': Error in getSymbols.yahoo(Symbols = "OGN", env = <environment>, verbose = FALSE, : Unable to import "OGN".
## OGN download failed after two attempts. Error message:
## HTTP error 400.
##  Removing OGN.
SP_prices_in_pandemic