covid | R Documentation |
tsibble
) and Victoria LGA (in sf
)Daily COVID count data (covid
) from 2022-01-01 to 2020-03-23 in a
tsibble object (date
, lga
, n
, and avg_7day
).
Victoria Local Government Area (LGA) spatial geometry in an sf object
(lga_name_2018
and geometry
)
covid
lga
An object of class tbl_ts
(inherits from tbl_df
, tbl
, data.frame
) with 6806 rows and 4 columns.
An object of class sf
(inherits from data.frame
) with 80 rows and 2 columns.
date object, from 2022-01-01 to 2020-03-23
Victoria Local Government Area (LGA) in Australia
COVID-19 case count
rolling mean of n
in a 7 day window.
Calculate with mutate(avg_7day = slider::slide_dbl(n,
mean, .before = 6))
LGA encoding by Australia Bureau of Statistics,
slightly differ from the encoding used by the Department of Health
in the covid
data
multipolygon geometry of each LGA
library(sf)
library(dplyr)
# prompt msg on the key mismatch between the two datasets
make_cubble(lga, covid, by = c("lga_name_2018" = "lga"))
check_res <- check_key(lga, covid, by = c("lga_name_2018" = "lga"))
# fix mismatch
lga2 <- lga |>
rename(lga = lga_name_2018) |>
mutate(lga = ifelse(lga == "Kingston (C) (Vic.)", "Kingston (C)", lga),
lga = ifelse(lga == "Latrobe (C) (Vic.)", "Latrobe (C)", lga)) |>
filter(!lga %in% check_res$others$spatial)
covid2 <- covid |> filter(!lga %in% check_res$others$temporal)
make_cubble(spatial = lga2, temporal = covid2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.