Title: | Worldwide or Coordinates-Based Heat Maps |
---|---|
Description: | Easily plot heat maps of the world, based on continuous or categorical data. Country labels can also be added to the map. |
Authors: | Luigi Annicchiarico [cre, aut] |
Maintainer: | Luigi Annicchiarico <[email protected]> |
License: | GPL-3 |
Version: | 0.1.3 |
Built: | 2024-11-14 11:07:23 UTC |
Source: | CRAN |
This function generates a data frame with information about geometries and centroid coordinates of countries. You can choose whether to keep all the countries or only a subset.
geometries_data(exclude.iso.na = TRUE, countries.list = NULL)
geometries_data(exclude.iso.na = TRUE, countries.list = NULL)
exclude.iso.na |
if |
countries.list |
List of the ISO 3166-1 alpha-2 codes of countries that are to be included. By default it is set to |
an object of class data.frame
and sf
.
geometries_data(countries.list = c("IT", "FR", "US"))
geometries_data(countries.list = c("IT", "FR", "US"))
Data from a random simulation with continuous data.
data(testdata1)
data(testdata1)
An object of class data.frame
data(testdata1) head(testdata1)
data(testdata1) head(testdata1)
Data from a random simulation with continuous and categorical data.
data(testdata1b)
data(testdata1b)
An object of class data.frame
data(testdata1b) head(testdata1b)
data(testdata1b) head(testdata1b)
Data from a random simulation with continuous and categorical data. This data set contains information about 237 countries (countries without unique ISO 3166 code are excluded).
data(testdata1c)
data(testdata1c)
An object of class data.frame
data(testdata1c) head(testdata1c)
data(testdata1c) head(testdata1c)
Plot a world heat map based on a continuous variable.
worldplot( data, ColName, CountryName, CountryNameType = "isoa2", rangeVal, longitude = c(-180, 180), latitude = c(-90, 90), crs = 4326, title = "", legendTitle = as.character(ColName), annote = FALSE, div = 1, palette_option = "D" )
worldplot( data, ColName, CountryName, CountryNameType = "isoa2", rangeVal, longitude = c(-180, 180), latitude = c(-90, 90), crs = 4326, title = "", legendTitle = as.character(ColName), annote = FALSE, div = 1, palette_option = "D" )
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 |
rangeVal |
Limit values that are to be defined for the map. |
longitude |
Longitude limits. Default is |
latitude |
Latitude limits. Default is |
crs |
Coordinate reference system (EPSG). By default the value is 4326, which corresponds to EPSG::4326 (WGS84) |
title |
Title of the plot. Default is no title. |
legendTitle |
Title of the legend. Default is the name of the filling variable. |
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". |
a map
data(testdata1b) worldplot(data = testdata1b, div = 1, ColName = "VNum", CountryName = "Cshort", CountryNameType = "isoa2", rangeVal = c(0,50), annote = FALSE)
data(testdata1b) worldplot(data = testdata1b, div = 1, ColName = "VNum", CountryName = "Cshort", CountryNameType = "isoa2", rangeVal = c(0,50), annote = FALSE)
Plot a world heat map based on a categorical variable.
worldplotCat( data, ColName, CountryName, CountryNameType, longitude = c(-180, 180), latitude = c(-90, 90), crs = 4326, title = "", legendTitle = as.character(ColName), Categories = levels(factor(map_df$MapFiller)), na.as.category = TRUE, annote = FALSE, div = 1, palette_option = "D" )
worldplotCat( data, ColName, CountryName, CountryNameType, longitude = c(-180, 180), latitude = c(-90, 90), crs = 4326, title = "", legendTitle = as.character(ColName), Categories = levels(factor(map_df$MapFiller)), na.as.category = TRUE, annote = FALSE, div = 1, palette_option = "D" )
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 |
crs |
Coordinate reference system (EPSG). By default the value is 4326, which corresponds to EPSG::4326 (WGS84) |
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 |
a map
data(testdata1b) worldplotCat(data = testdata1b, div = 1, ColName = "VCat", CountryName = "Cshort", CountryNameType = "isoa2", annote = FALSE)
data(testdata1b) worldplotCat(data = testdata1b, div = 1, ColName = "VCat", CountryName = "Cshort", CountryNameType = "isoa2", annote = FALSE)