Get specified table from OxCOVID19 Database

get_table(con, tbl_name)

get_tables(con, tbl_names)

Arguments

con

Connection to OxCOVID19 Database. This can be specified using the connect_oxcovid19() function.

tbl_name

Name of table available in OxCOVID19 Database. Should be one of the table names given by a call to list_tables().

tbl_names

Name of tables available in OxCOVID19 Database. Should be a character vector of names of tables found in the table names given by a call to list_tables().

Value

For get_table(), an RPostgres_tbl object of the specified OxCOVID19 Database table. For get_tables(), an RPostgres_tbl object containing a named list of the specified OxCOVID19 Database tables.

Author

Ernest Guevarra

Examples

## Create a connection to OxCOVID19 Database con <- connect_oxcovid19() ## Get epidemiology table get_table(con = con, tbl_name = "epidemiology")
#> # Source: table<epidemiology> [?? x 15] #> # Database: postgres [covid19@covid19db.org:5432/covid19] #> source date country countrycode adm_area_1 adm_area_2 adm_area_3 tested #> <chr> <date> <chr> <chr> <chr> <chr> <chr> <int> #> 1 JPN_C… 2020-10-11 Japan JPN Gifu NA NA 24149 #> 2 USA_N… 2020-08-03 United… USA Idaho Boise NA NA #> 3 USA_N… 2020-08-07 United… USA Massachus… Plymouth NA NA #> 4 USA_N… 2020-08-07 United… USA Michigan Alcona NA NA #> 5 USA_N… 2020-08-07 United… USA Michigan Otsego NA NA #> 6 WRD_W… 2020-06-07 Guatem… GTM NA NA NA NA #> 7 USA_N… 2020-08-07 United… USA Minnesota Kittson NA NA #> 8 USA_N… 2020-08-07 United… USA Minnesota Koochichi… NA NA #> 9 USA_N… 2020-08-07 United… USA Minnesota Lake NA NA #> 10 GBR_P… 2020-04-30 United… GBR NA NA NA 933455 #> # … with more rows, and 7 more variables: confirmed <int>, recovered <int>, #> # dead <int>, hospitalised <int>, hospitalised_icu <int>, quarantined <int>, #> # gid <chr>
## Get epidemiology and weather tables get_tables(con = con, tbl_names = c("epidemiology", "weather"))
#> [[1]] #> # Source: table<epidemiology> [?? x 15] #> # Database: postgres [covid19@covid19db.org:5432/covid19] #> source date country countrycode adm_area_1 adm_area_2 adm_area_3 tested #> <chr> <date> <chr> <chr> <chr> <chr> <chr> <int> #> 1 JPN_C… 2020-10-11 Japan JPN Gifu NA NA 24149 #> 2 USA_N… 2020-08-03 United… USA Idaho Boise NA NA #> 3 USA_N… 2020-08-07 United… USA Massachus… Plymouth NA NA #> 4 USA_N… 2020-08-07 United… USA Michigan Alcona NA NA #> 5 USA_N… 2020-08-07 United… USA Michigan Otsego NA NA #> 6 WRD_W… 2020-06-07 Guatem… GTM NA NA NA NA #> 7 USA_N… 2020-08-07 United… USA Minnesota Kittson NA NA #> 8 USA_N… 2020-08-07 United… USA Minnesota Koochichi… NA NA #> 9 USA_N… 2020-08-07 United… USA Minnesota Lake NA NA #> 10 GBR_P… 2020-04-30 United… GBR NA NA NA 933455 #> # … with more rows, and 7 more variables: confirmed <int>, recovered <int>, #> # dead <int>, hospitalised <int>, hospitalised_icu <int>, quarantined <int>, #> # gid <chr> #> #> [[2]] #> # Source: table<weather> [?? x 56] #> # Database: postgres [covid19@covid19db.org:5432/covid19] #> source date gid country countrycode adm_area_1 adm_area_2 adm_area_3 #> <chr> <date> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 MET 2020-02-23 DMA.… Domini… DMA Saint Paul NaN NaN #> 2 MET 2020-02-23 DMA.… Domini… DMA Saint Jos… NaN NaN #> 3 MET 2020-02-23 DMA.… Domini… DMA Saint And… NaN NaN #> 4 MET 2020-02-23 JAM.… Jamaica JAM Saint Eli… NaN NaN #> 5 MET 2020-02-23 JAM.… Jamaica JAM Clarendon NaN NaN #> 6 MET 2020-02-23 JAM.… Jamaica JAM Saint Cat… NaN NaN #> 7 MET 2020-02-23 JAM.… Jamaica JAM Manchester NaN NaN #> 8 MET 2020-02-23 JAM.… Jamaica JAM Saint And… NaN NaN #> 9 MET 2020-02-23 JAM.… Jamaica JAM Saint Tho… NaN NaN #> 10 MET 2020-02-23 JAM.… Jamaica JAM Portland NaN NaN #> # … with more rows, and 48 more variables: samplesize <int>, #> # precipitation_max_avg <dbl>, precipitation_max_std <dbl>, #> # precipitation_mean_avg <dbl>, precipitation_mean_std <dbl>, #> # humidity_max_avg <dbl>, humidity_max_std <dbl>, humidity_mean_avg <dbl>, #> # humidity_mean_std <dbl>, humidity_min_avg <dbl>, humidity_min_std <dbl>, #> # sunshine_max_avg <dbl>, sunshine_max_std <dbl>, sunshine_mean_avg <dbl>, #> # sunshine_mean_std <dbl>, temperature_max_avg <dbl>, #> # temperature_max_std <dbl>, temperature_mean_avg <dbl>, #> # temperature_mean_std <dbl>, temperature_min_avg <dbl>, #> # temperature_min_std <dbl>, windgust_max_avg <dbl>, windgust_max_std <dbl>, #> # windgust_mean_avg <dbl>, windgust_mean_std <dbl>, windgust_min_avg <dbl>, #> # windgust_min_std <dbl>, windspeed_max_avg <dbl>, windspeed_max_std <dbl>, #> # windspeed_mean_avg <dbl>, windspeed_mean_std <dbl>, #> # windspeed_min_avg <dbl>, windspeed_min_std <dbl>, #> # cloudaltitude_max_valid <dbl>, cloudaltitude_max_avg <dbl>, #> # cloudaltitude_max_std <dbl>, cloudaltitude_min_valid <dbl>, #> # cloudaltitude_min_avg <dbl>, cloudaltitude_min_std <dbl>, #> # cloudaltitude_mean_valid <dbl>, cloudaltitude_mean_avg <dbl>, #> # cloudaltitude_mean_std <dbl>, cloudfrac_max_avg <dbl>, #> # cloudfrac_max_std <dbl>, cloudfrac_min_avg <dbl>, cloudfrac_min_std <dbl>, #> # cloudfrac_mean_avg <dbl>, cloudfrac_mean_std <dbl> #>