This functions pulls US testing counts of COVID-19 data from covidtracking.com. The data is aggregated by FIPS and data, and is tidy so that it is more user friendly. No data is stored within the package, so the data should continuously update over time as long as the links do not change.

covtrck_states_testing()

Value

A tsibble/dataframe/tibble

Details

Website: https://covidtracking.com/api

Deprecated fields The following fields are deprecated and are no longer being updated with new data.

/api/v1/states/current.json:

positiveScore negativeScore negativeRegularScore commercialScore score grade - Use dataQualityGrade instead total

/api/v1/us/current.json

posNeg total

Examples

tests_daily <- R.COVID.19::covtrck_states_testing()
#> Parsed with column specification: #> cols( #> .default = col_double(), #> state = col_character(), #> totalTestResultsSource = col_character(), #> lastUpdateEt = col_character(), #> dateModified = col_datetime(format = ""), #> checkTimeEt = col_character(), #> dateChecked = col_datetime(format = ""), #> fips = col_character(), #> dataQualityGrade = col_logical(), #> hash = col_character(), #> grade = col_logical() #> )
#> See spec(...) for full column specifications.
#> `mutate_if()` ignored the following grouping variables: #> Column `fips`
#> `mutate_if()` ignored the following grouping variables: #> Column `fips`
head(tests_daily)
#> # A tsibble: 6 x 59 [1D] #> # Key: fips [1] #> # Groups: fips [1] #> greg_d date fips state total_tests positive negative pending #> <date> <dbl> <chr> <chr> <dbl> <dbl> <dbl> <dbl> #> 1 2020-03-07 2.02e7 01 AL 0 0 0 0 #> 2 2020-03-08 2.02e7 01 AL 0 0 0 0 #> 3 2020-03-09 2.02e7 01 AL 0 0 0 0 #> 4 2020-03-10 2.02e7 01 AL 0 0 0 0 #> 5 2020-03-11 2.02e7 01 AL 10 0 10 0 #> 6 2020-03-12 2.02e7 01 AL 10 0 10 0 #> # ... with 51 more variables: total_tests_increase <dbl>, #> # pendingIncrease <dbl>, positiveIncrease <dbl>, negativeIncrease <dbl>, #> # totalTestResults <dbl>, totalTestResultsIncrease <dbl>, recovered <dbl>, #> # recoveredIncrease <dbl>, death <dbl>, deathIncrease <dbl>, #> # hospitalized <dbl>, hospitalizedIncrease <dbl>, probableCases <dbl>, #> # totalTestResultsSource <chr>, hospitalizedCurrently <dbl>, #> # hospitalizedCumulative <dbl>, inIcuCurrently <dbl>, inIcuCumulative <dbl>, #> # onVentilatorCurrently <dbl>, onVentilatorCumulative <dbl>, #> # lastUpdateEt <chr>, dateModified <dttm>, checkTimeEt <chr>, #> # hospitalizedDischarged <dbl>, dateChecked <dttm>, totalTestsViral <dbl>, #> # positiveTestsViral <dbl>, negativeTestsViral <dbl>, #> # positiveCasesViral <dbl>, deathConfirmed <dbl>, deathProbable <dbl>, #> # totalTestEncountersViral <dbl>, totalTestsPeopleViral <dbl>, #> # totalTestsAntibody <dbl>, positiveTestsAntibody <dbl>, #> # negativeTestsAntibody <dbl>, totalTestsPeopleAntibody <dbl>, #> # positiveTestsPeopleAntibody <dbl>, negativeTestsPeopleAntibody <dbl>, #> # totalTestsPeopleAntigen <dbl>, positiveTestsPeopleAntigen <dbl>, #> # totalTestsAntigen <dbl>, positiveTestsAntigen <dbl>, #> # dataQualityGrade <lgl>, hash <chr>, commercialScore <dbl>, #> # negativeRegularScore <dbl>, negativeScore <dbl>, positiveScore <dbl>, #> # score <dbl>, grade <lgl>