This function produce different kinds of maps for the rmap package. Each figure is accompanied with a csv table.

map_plot(
  data = NULL,
  region = NULL,
  fillColumn = NULL,
  shape = NULL,
  theme = NULL,
  show = T,
  subRegion = "subRegion",
  value = "value",
  x = NULL,
  class = "class",
  scenario = "scenario",
  palette = "Set3",
  legendType = "kmeans",
  labels = F,
  labelCol = NULL,
  labelRepel = 0,
  labelColor = "black",
  labelSize = 2,
  labelAlpha = 1,
  labelFill = NA,
  labelBorderSize = NA,
  width = 9,
  height = 7,
  legendShow = T,
  legendTitle = NULL,
  legendBreaksn = 5,
  legendBreaks = NULL,
  pdfpng = "png",
  underLayer = NULL,
  color = "grey40",
  lwd = 0.1,
  underLayerLabelCol = NULL,
  underLayerColor = "gray40",
  underLayerFill = "gray90",
  underLayerLwd = 0.1,
  underLayerAlpha = 1,
  underLayerLabels = F,
  overLayerLabelCol = NULL,
  overLayerLabels = F,
  overLayer = NULL,
  overLayerColor = "gray40",
  overLayerFill = NA,
  overLayerLwd = 0.2,
  overLayerAlpha = 0,
  zoom = 0,
  zoomx = NULL,
  zoomy = NULL,
  asp = 1.2,
  save = T,
  fileName = "map",
  folder = paste(getwd(), "/outputs", sep = ""),
  row = NULL,
  col = NULL,
  title = NULL,
  numeric2Cat_list = NULL,
  catParam = NULL,
  legendDigits = NULL,
  legendDigitsOverride = NULL,
  legendSingleColor = "white",
  legendSingleValue = F,
  colorNA = "gray50",
  showNA = F,
  ncol = 3,
  size = 16,
  alpha = 1,
  background = F,
  crop = T,
  crop_to_underLayer = F,
  crop_to_overLayer = F,
  transparent = F,
  crs = "+proj=longlat +datum=WGS84 +no_defs"
)

Arguments

data

Default = NULL

region

Default = NULL. Set the boundary region for subRegion maps. Useful when multiple subRegions in different regions.

fillColumn

Default = NULL # Or give column with data

shape

Default = NULL, Cusotm shape can be provided as a SpatialPolygonDataFrame with features corresponding to subRegion columns in the data provided.

theme

Default = NULL

show

Default = T. Print maps in console as they are processed.

subRegion

Default ="subRegion",

value

Default = "value",

x

Default = NULL

class

Default = "class"

scenario

Default = "scenario"

palette

Default = "Set3"

legendType

Default = "continuous".

labels

Default = FALSE

labelCol

Default = NULL,

labelRepel

Default = 0,

labelColor

Default = "black",

labelSize

Default = 3

labelAlpha

Default = 0.7,

labelFill

Default = NA,

labelBorderSize

Default = NA

width

Default = 9

height

Default = 7

legendShow

Default = F

legendTitle

Default = NULL

legendBreaksn

Default = "5"

legendBreaks

Default = NULL

pdfpng

Default = "png"

underLayer

Default = NULL

color

Default = "grey40". Color of polygon lines.

lwd

Default = 0.1. Line width of polygon boundaries.

underLayerLabelCol

Default = NULL

underLayerColor

Default = "gray40"

underLayerFill

Default = "gray40"

underLayerLwd

Default = 0.5

underLayerAlpha

Default = 1

underLayerLabels

Default = F

overLayerLabelCol

Default = NULL

overLayerLabels

Default = F

overLayer

Default = NULL

overLayerColor

Default = "gray40"

overLayerFill

Default = NA

overLayerLwd

Default = 0.5

overLayerAlpha

Default = 0

zoom

Default =-1. Zoom into or out of map. Positive values zoom in and negative out.

zoomx

Default = NULL. Zoom into or out of map along x. Positive values zoom in and negative out.

zoomy

Default = NULL. Zoom into or out of map along y. Positive values zoom in and negative out.

asp

Default = 1.2. Aspect ratio of lat and lon.

save

Default = T

fileName

Default = "map"

folder

Default = paste(getwd(),"/outputs",sep Default = "")

row

Default=NULL

col

Default=NULL

title

Default=NULL

numeric2Cat_list

Default=NULL

catParam

Default=NULL

legendDigits

Default = NULL

legendDigitsOverride

Default=NULL

legendSingleColor

Default="white"

legendSingleValue

Default=F. Change to True to get default single value or provide a numeric value.

colorNA

Default = "gray50"

showNA

Default = T

ncol

Default = 3. Number of columns to wrap maps

size

Default = 12. Text size of plots.

alpha

Default = 1. Transparency of fill colors.

background

Default = F. T adds background water color, border and default underlayer map. If background is set to a color (e.g. background = "grey10") then map will be produced with water of that color, a border and underlayer map.

crop

Default = T. Crop to boundary data.

crop_to_underLayer

Default = F. Crop to the underLayer boundary provided.

crop_to_overLayer

Default = F. Crop to the overLayer boundary provided.

transparent

Default = F. To make map background transparent for maps without backgrounds.

crs

Default = "+proj=longlat +datum=WGS84 +no_defs". A proj4 string from EPSG https://epsg.io/

Value

Returns the formatted data used to produce chart