For an object read in with a LoadCountry function, sets the per capita active cases (pInf) to NA or removes them from the dataset based on input conditions. Can be used to remove data that is not recent, or data that produces low or negative estimates of per capita cases, or risk. Can also be used to remove data that is NA by country or by region.
tidy_Data(
DATA,
tidy = TRUE,
DaysOld = 30,
minimumpercapitaactivecases = 0,
RiskEval = NULL,
dropNACountry = TRUE,
dropNAall = FALSE
)
Data created using a LoadCountry call.
If TRUE, then perform tidying according to other parameters. If FALSE, then do nothing.
Set any pInf data more than this days old to NA.
Set any pInf data less than this to NA.
Set pInf to NA when risk is below RiskEval$minimumRisk (%) using RiskEval$ascertainmentbias and a maximum group size, RiskEval$maximumN (Note: this setting overwrites minimumpercapitaactivecases).
If TRUE, remove rows for countries whose pInf estimates all return NA.
If TRUE, remove rows for any region whose pInf estimates all return NA
Returns input simple feature with NA values for pInf according to input options.
if (FALSE) {
Europe1 <- LoadEurope() #tidy_Data is run within LoadX functions.
Europe2 <- LoadEurope(tidy = FALSE)
Europe2 <- tidy_Data(Europe2)
}