covidsymptom (version 1.0.0)

get_latest_data: Retrieve updated COVID Symptom Study Sweden (CSSS) data

Description

This function was originally designed to download the latest version of CSSS data dynamically. Due to the cessation of data updates from the COVID Symptom Study Sweden, this function now checks if locally stored data is up-to-date and notifies the user accordingly. The function will not fetch new data from online sources.

Usage

get_latest_data(data_level = c("national", "county", "postcode"))

Value

This function returns a data.frame containing the data for the specified level. Data returned is the last available snapshot stored within the package.

Arguments

data_level

A character string specifying which data set from CSSS you want to "download". Can be "national" (default), "county", or "postcode".

Author

Hugo Fitipaldi

Details

Note: As the COVID Symptom Study Sweden is no longer updating their data sets, this function serves as a demonstration of how data updates could be managed without needing frequent package updates. It returns the data that was last available before updates were discontinued.

Examples

Run this code
# The following example demonstrates how to retrieve data at the county level.
df <- get_latest_data(data_level = "county")

Run the code above in your browser using DataLab