country_categories: Clean category data frame to help plot new country fill...

Description Usage Arguments Value Note Author(s)

View source: R/country_categories.R

Description

This script contains a function to create a data frame to help reassign participating country fill in a ggplot object created from plot_WG_map() or plot_geocode_map().

Usage

1
country_categories(cat_data_orig, cat_countries_ISO3, cols, WG_i)

Arguments

cat_data_orig

same as category_data in category_maps(). This data frame must contain 3 columns labeled "Acronym" (for the WG or plotname), "Countries" (A list of SOOS named countries separated by a ";") and "Categories" (a list of assigned categories for each SOOS country). See example file for details. Note the categories should be ordered from low-high and can be numbers or a caracter vector corresponding to names in the "Categories" column. The highest ranking category will be decide the country fill.

cat_countries_ISO3

ISO3 codes returned by passing cat_data_original through check_country_names().

cols

The ordered colour vector for categories.

WG_i

The row of cat_data_orig that data is being generated for.

Value

a data frame with the columns "ISO3" (ISO3 ccountry code), "cat" (category ID) and "fill" (assigned fill colour)

Note

v.0.1

Author(s)

Kimberlee Baldry


KimBaldry/mapSOOSWG documentation built on March 13, 2021, 6:57 p.m.