Description Usage Arguments Value Examples
View source: R/data_pull_fcns.R
This function supplies a wrapper to fetch the results from a SQL query from WEDSS and then performs basic data cleaning to calculate the confirmed case metrics.
1 | pull_wedss(query, conn, end_date = NULL)
|
query |
query to pull data from WEDSS. This call should only pull counties or jurisdictions that will automatically be aggregated into HERC regions and Statewide. |
conn |
connection to database (see |
end_date |
(default = NULL) If specified it is the end date of the time series that you wish to analyze. It should be something coercible to Date format with as.Date. If you want all data leave it blank. |
a cleaned version of the COVID-19 Historical Data Table including HERC regions with the following columns
renamed from GEOID
renamed from GEO
renamed from NAME
LoadDttm converted to Date format
cleaned daily new positive cases from POS_NEW except for the first day which is from POSITIVE
cleaned daily new total tests from TEST_NEW except for the first day which is from POSITIve + NEGATIVE
cleaned daily new deaths from DTH_NEW except for the first day which is from DEATHS
2018 Population Numbers pulled from WISH
daily cumulative positive cases calculated from case_daily
daily cumulative total tests calculated from test_daily
daily cumulative deaths calculated from death_daily
and likely one or more of the following columns if applicable
original daily new positive cases before cleaning
original daily new total tests before cleaning
cleaned daily new deaths before cleaning
1 2 3 4 5 6 7 8 9 | ## Not run:
library(RODBC)
channel <- odbcConnect("databasename", ...)
sql_query <- "SELECT * FROM TABLE WHERE GEO = 'COUNTY'"
hdt <- pull_wedss(query = sql_query, conn = channel, end_date = as.Date("2020-06-24"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.