Learn R Programming

covidregionaldata (version 0.8.2)

rename_region_code_column: Helper to rename the region code column in each dataset to the correct code type for each country (e.g. ISO-3166-2).

Description

The package relies on column name 'region_level_1_code' etc. during processing but this often isn't the most sensible name for the column (e.g. iso-3166-2 makes more sense for US states). This simply renames the column as the final step in processing before returning data to the user.

Usage

rename_region_code_column(data, country)

Arguments

data

a data frame with a region_level_1_code column and optionally a region_level_2_code column

country

a string with the country of interest

Value

a tibble with the column(s) renamed to a sensible name