Learn R Programming

covidregionaldata (version 0.8.2)

rename_region_column: Helper to rename the region column in each dataset to the correct name for each country.

Description

The package relies on column name 'region' during processing but this often isn't the most sensible name for the column (e.g. state makes more sense for USA). This simply renames the column as the final step in processing before returning data to the user.

Usage

rename_region_column(data, country)

Arguments

data

a data frame with a region_level_1 column and optionally a region_level_2 column

country

a string with the country of interest

Value

a tibble with the column renamed to a sensible name