View source: R/read_subset_covid.R
| read_subset_covid | R Documentation |
Lazily reads a subset of a locally saved COVerAGE-DB dataset. Data manipulation is handled lazily.
read_subset_covid(
zippath,
data = c("inputDB", "Output_5", "Output_10", "qualityMetrics"),
return = c("data.frame", "data.table", "tibble"),
Country,
Region,
Sex,
Date
)
zippath |
Character. The local zip archive of the downloaded dataset. |
data |
The name of the dataset that is to be read. Can be one of the the following: "inputDB", "Output_5", "Output_10", "qualityMetrics". |
return |
What should be the return type? Can be on of the following: "data.frame", "data.table", "tibble". |
Country |
Character vector of countries to select. |
Region |
Character vector of regions to select. |
Sex |
Character vector of sexes to select. Usually either 'b' for both. 'f' for females, and 'm' for males. |
Date |
Either a character or Date vector of dates to include. If a character vector. |
The function uses vroom as backend for reading the dataset lazily. The result of this is a memory efficient processing of the data. This approach tends to be slower than reading the whole dataset in memory. Nevertheless, the cost in speed is advantageous to be able to work with very large datasets, or to generally conserve memory the R process uses. Specifically, this is useful for reading the 'inputDB' dataset, which currently holds millions of rows.
By default a data frame with the subsetted dataset. Can be set to return either a data table or a tibble. The return type is controlled by the 'return' parameter.
Erez Shomron
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.