rkidata cut-off date is not correct, because it is based on `Refdatum`
-
The following change should be implemented in the automated
rkidata
update procedure:- updateRkidataFile() should use
Meldedatum
and notRefdatum
to select rkidata. Here is the correct code fragment:
- updateRkidataFile() should use
rkidata <- rkidataFull[which(rkidataFull$Meldedatum >= as.Date("2020-09-01")), ]
names(rkidata) <- c("FID", "IdBundesland", "Bundesland", "Landkreis",
"Altersgruppe", "Geschlecht", "AnzahlFall",
"AnzahlTodesfall", "Refdatum", "IdLandkreis",
"Datenstand", "NeuerFall", "NeuerTodesfall",
"Meldedatum", "NeuGenesen", "AnzahlGenesen",
"IstErkrankungsbeginn", "Altersgruppe2")
usethis::use_data(name = rkidata, overwrite = overwrite)
- To illustrate the difference, the wrong code is shown below:
rkidata <- rkidataFull[which(rkidataFull$Refdatum >= as.Date("2020-09-01")), ]
names(rkidata) <- c("FID", "IdBundesland", "Bundesland", "Landkreis",
"Altersgruppe", "Geschlecht", "AnzahlFall",
"AnzahlTodesfall", "Refdatum", "IdLandkreis",
"Datenstand", "NeuerFall", "NeuerTodesfall",
"Meldedatum", "NeuGenesen", "AnzahlGenesen",
"IstErkrankungsbeginn", "Altersgruppe2")
usethis::use_data(name = rkidata, overwrite = overwrite)
- To check whether it is correct, you can perform the following test:
- Correct output :-):
> min(babsim.hospital::rkidata$Refdatum)
[1] "2020/09/01 00:00:00"
- False output (this is the current state :-( ):
> min(babsim.hospital::rkidata$Refdatum)
[1] "2020/03/10 00:00:00"