worldplot {WorldMapR}R Documentation

worldplot

Description

Plot a world heat map based on a continuous variable.

Usage

worldplot(
  data,
  ColName,
  CountryName,
  CountryNameType = "isoa2",
  rangeVal,
  longitude = c(-180, 180),
  latitude = c(-90, 90),
  title = "",
  legendTitle = as.character(ColName),
  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 CountryName. One of isoa2 (default), isoa3, or name.

rangeVal

Limit values that are to be defined for the map.

longitude

Longitude limits. Default is c(-180, 180) (whole world).

latitude

Latitude limits. Default is c(-90, 90) (whole world).

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 FALSE.

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".

save

Save the plot in a jpg file?

filename

Only if is save set to TRUE. Name of the file.

path

Only if save is set to TRUE. Path of the directory where the file is to be saved.

width

Only if save is set to TRUE. Width of the file.

height

Only if save is set to TRUE. Height of the file.

units

Only if save is set to TRUE. Units for width and height. Can be 'cm', 'mm', 'in', or 'px'.

scale

Only if save is set to TRUE. Scaling factor for adjusting image dimensions.

Value

a map

Examples

data(testdata1b)
worldplot(data = testdata1b,
          div = 1,
          ColName = "VNum",
          CountryName = "Cshort",
          CountryNameType = "isoa2",
          rangeVal = c(0,50),
          annote = FALSE)


[Package WorldMapR version 0.1.1 Index]