read.spf: Read Santé Publique France data

Description Usage Arguments Details Value Examples

View source: R/read.spf.r

Description

Read Santé Publique France data

Usage

1
read.spf(file = c("-", "nouveaux", "classe-age", "etablissements"))

Arguments

file

which file to read

Details

This function reads one the files described at https://www.data.gouv.fr/fr/datasets/donnees-hospitalieres-relatives-a-lepidemie-de-covid-19/ and do some cleaning.

Value

A data frame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
covid <- read.spf("nouveaux")
covid <- agg(covid, 3:6, 2)
covid$rolling_hosp <- rolling.mean(covid$incid_hosp, 7, "right")
covid$rolling_rea  <- rolling.mean(covid$incid_rea,  7, "right")
covid$rolling_dc   <- rolling.mean(covid$incid_dc,   7, "right")
covid$rolling_rad  <- rolling.mean(covid$incid_rad,  7, "right")


plot(covid$jour, covid$incid_dc, type = "h")
lines(covid$jour, covid$rolling_dc, col = "red", lwd = 2)

HervePerdry/covid19.SPF documentation built on Jan. 30, 2022, 7:22 p.m.