worldplotCat {WorldMapR} | R Documentation |
worldplotCat
Description
Plot a world heat map based on a categorical variable.
Usage
worldplotCat(
data,
ColName,
CountryName,
CountryNameType,
longitude = c(-180, 180),
latitude = c(-90, 90),
title = "",
legendTitle = as.character(ColName),
Categories = levels(factor(map_df$MapFiller)),
na.as.category = TRUE,
annote = FALSE,
div = 1,
palette_option = "D",
save = FALSE,
filename = "worldplot.jpg",
path = tempdir(),
width = 20,
height = 10,
units = "cm",
scale = 1
)
Arguments
data |
Data set containing the list of nations and the variable that we want to plot. |
ColName |
Character variable with the name of the variable of interest. |
CountryName |
Character variable with the name of the country names column. |
CountryNameType |
Character variable with the coding for |
longitude |
Longitude limits. Default is |
latitude |
Latitude limits. Default is |
title |
Title of the plot. Default is no title. |
legendTitle |
Title of the legend. Default is the name of the filling variable. |
Categories |
categories labels to be plotted in the legend. |
na.as.category |
Treat |
annote |
Do you want to plot country labels (ISO 3166-1 alpha-2 code) on the map? Default is set to |
div |
Parameter for modifying the elements dimensions in the map. Usually, it does not need to be modified. Default value is 1. |
palette_option |
Character string indicating the palette to be used. Available options range between "A" and "H". You can also enter a string with a colour for each category |
save |
Save the plot in a jpg file? |
filename |
Only if is save set to |
path |
Only if save is set to |
width |
Only if save is set to |
height |
Only if save is set to |
units |
Only if save is set to |
scale |
Only if save is set to |
Value
a map
Examples
data(testdata1b)
worldplotCat(data = testdata1b,
div = 1,
ColName = "VCat",
CountryName = "Cshort",
CountryNameType = "isoa2",
annote = FALSE)