Description Usage Arguments Value Examples
This general purpose function can be used to generate a country map for a single variable. It has few defaults but
the data supplied must contain a region_code
variable for linking to mapping data. This function requires
the installation of the rnaturalearth
package.
1 2 3 4 5 6 7 8 9 10 |
data |
Dataframe containing variables to be mapped. Must contain a |
country |
Character string indicating the name of the country to be mapped. |
variable |
A character string indicating the variable to map data for. This must be supplied. |
variable_label |
A character string indicating the variable label to use. If not supplied then the underlying variable name is used. |
trans |
A character string specifying the transform to use on the specified metric. Defaults to no
transform ("identity"). Other options include log scaling ("log") and log base 10 scaling
("log10"). For a complete list of options see |
fill_labels |
A function to use to allocate legend labels. An example (used below) is |
scale_fill |
Function to use for scaling the fill. Defaults to a custom |
... |
Additional arguments passed to the |
A ggplot2
object containing a country map.
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.