knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

covid19swiss

build CRAN_Status_Badge lifecycle License: MIT GitHub commit

The covid19swiss R package provides a tidy format dataset of the 2019 Novel Coronavirus COVID-19 (2019-nCoV) pandemic outbreak in Switzerland cantons and the Principality of Liechtenstein (FL). The covid19swiss dataset includes the following fields:

Where the available data_type field includes the following cases:

More information can be found the following vignettes:

Data source: Specialist Unit for Open Government Data Canton of Zurich , raw data is available on the following repository. Special thanks for all the people that collaborate and contribute to pull the data from multiple sources and make this data available!

Installation

You can install the released version of covid19swiss from CRAN with:

install.packages("covid19swiss")

Or, install the most recent version from GitHub with:

# install.packages("devtools")
devtools::install_github("Covid19R/covid19swiss")

Data refresh

The covid19swiss package dev version is been updated on a daily bases. The update_swiss_data function enables a simple refresh of the installed package datasets with the most updated version on Github:

library(covid19swiss)

update_swiss_data()

More information about updating the data is available on this vignette

Note: must restart the R session after using the update_swiss_data function in order to have the updates available

Usage

data(covid19swiss)

head(covid19swiss)

Wide format

library(tidyr)

covid19swiss_wide <- covid19swiss %>% 
  pivot_wider(names_from = data_type, values_from = value)

head(covid19swiss_wide)

Missing values

The data is collected from multiple resources on the canton level, and not necessarily each data resource provides the same field. Therefore, some fields, such as total recovered or total tested may not be available at this point for some cantons and are marked as missing values (i.e., NA).

Contributing

Please submit issues and pull requests with any package improvements!

Please note that the ‘covid19swiss’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.



RamiKrispin/covid19swiss documentation built on May 18, 2020, 11:54 a.m.