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

map(
  data = NULL,
  region = NULL,
  fillColumn = NULL,
  shape = NULL,
  fileName = "map",
  save = T,
  theme = NULL,
  show = T,
  folder = paste(getwd(), "/outputs", sep = ""),
  labels = F,
  labelCol = NULL,
  labelRepel = 0,
  labelColor = "black",
  labelSize = 2,
  labelAlpha = 1,
  labelFill = NA,
  labelBorderSize = NA,
  shapeFolder = NULL,
  shapeFile = NULL,
  subRegion = "subRegion",
  value = "value",
  x = NULL,
  class = "class",
  scenario = "scenario",
  nameAppend = "",
  legendTitle = NULL,
  legendType = "kmeans",
  legendBreaksn = 5,
  legendFixedBreaks = NULL,
  animate = T,
  fps = 1,
  crop = T,
  crop_to_underLayer = F,
  crop_to_overLayer = F,
  fill = NULL,
  color = "grey40",
  lwd = 0.1,
  underLayer = NULL,
  underLayerColor = "gray40",
  underLayerFill = "gray90",
  underLayerLwd = 0.1,
  underLayerAlpha = 1,
  underLayerLabels = F,
  underLayerLabelCol = NULL,
  overLayerLabelCol = NULL,
  overLayerLabels = F,
  overLayer = NULL,
  overLayerColor = "gray40",
  overLayerFill = NA,
  overLayerLwd = 0.2,
  overLayerAlpha = 0,
  zoom = 0,
  zoomx = NULL,
  zoomy = NULL,
  asp = 1.2,
  projX = "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0",
  width = 7,
  height = 8,
  scenRef = NULL,
  scenDiff = NULL,
  scaleRange = NULL,
  scaleRangeDiffAbs = NULL,
  scaleRangeDiffPrcnt = NULL,
  xRef = NULL,
  xDiff = NULL,
  scaleRangexDiffAbs = NULL,
  scaleRangexDiffPrcnt = NULL,
  col = NULL,
  row = NULL,
  title = NULL,
  numeric2Cat_list = NULL,
  pdfpng = "png",
  legendDigitsOverride = NULL,
  legendSingleColor = "white",
  legendSingleValue = F,
  palette = NULL,
  paletteDiff = "pal_div_BluRd",
  colorNA = "gray50",
  showNA = F,
  ncol = 3,
  size = 16,
  alpha = 1,
  background = F,
  transparent = T,
  legendShow = T,
  legendShowForce = F,
  diffOnly = F,
  forceFacets = 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

(Optional). Default = NULL. Only for direct map plotting.

shape

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

fileName

(Optional). Default = "map". Only for direct map plotting.

save

(Optional). Default = T. Only for direct map plotting.

theme

Default = NULL,

show

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

folder

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

labels

Default = F,

labelCol

Default = NULL,

labelRepel

Default = 0,

labelColor

Default = "black",

labelSize

Default = 3

labelAlpha

Default = 0.7,

labelFill

Default = NA,

labelBorderSize

Default = NA

shapeFolder

Default = paste(getwd(),"/dataFiles/gis/admin_gadm36",sep=""),

shapeFile

Default = paste("gadm36_1",sep=""),

subRegion

Default ="subRegion",

value

Default = "value",

x

Default = NULL

class

Default = "class"

scenario

Default = "scenario"

nameAppend

Default =""

legendTitle

Default = NULL

legendType

Default ="kmeans", Options include c("pretty","kmeans","freescale","all")

legendBreaksn

Default = "5",

legendFixedBreaks

Default = NULL,

animate

Default = T,

fps

Default = 1,

crop

Default = T. This crops the map to the extent of your data regions. If false will zoom out to the extent of the larget layer.

crop_to_underLayer

Default = F. Crop to the underLayer boundary provided.

crop_to_overLayer

Default = F. Crop to the overLayer boundary provided.

fill

Default = NULL. Fill of polygon shapes. Same as palette.

color

Default = "grey40". Color of polygon lines.

lwd

Default = 0.1. Line width of polygon boundaries.

underLayer

Default = NULL

underLayerColor

Default = "gray40"

underLayerFill

Default = "gray90"

underLayerLwd

Default = 0.5

underLayerAlpha

Default = 1

underLayerLabels

Default = F

underLayerLabelCol

Default = NULL

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.

projX

Default = projX="+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"

width

Default =9

height

Default =7

scenRef

Reference Scenario. Default = NULL

scenDiff

Scenarios to Diff. Default = NULL

scaleRange

Default NULL. A vector with c(max,min) (Applied to all params) or a dataframe with cols param, max, min

scaleRangeDiffAbs

Default =NULL, A vector with c(max,min) (Applied to all params) or a dataframe with cols param, max, min

scaleRangeDiffPrcnt

Default =NULL, A vector with c(max,min) (Applied to all params) or a dataframe with cols param, max, min

xRef

Reference year. Default = NULL

xDiff

years to Diff. Default = NULL

scaleRangexDiffAbs

Default =NULL, A vector with c(max,min) (Applied to all params) or a dataframe with cols param, max, min

scaleRangexDiffPrcnt

Default =NULL, A vector with c(max,min) (Applied to all params) or a dataframe with cols param, max, min

col

Default ="multiFacetRow",

row

Default ="multiFacetCol",

title

Default=NULL

numeric2Cat_list

Default=NULL,

pdfpng

Save IO figures as pdf or png. Type=String. Options: 'pdf' or 'png'. Default = 'png'

legendDigitsOverride

Default=NULL

legendSingleColor

Default="white"

legendSingleValue

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

palette

Default = NULL

paletteDiff

Default = "pal_div_BrGn"

colorNA

Default = "gray50"

showNA

Default = F

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. Add background water color, border and default underlayer map.

transparent

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

legendShow

Default = T

legendShowForce

Default = F. Force legend to show for maps without values.

diffOnly

Default = F. Only run diff plots and not individual scenarios.

forceFacets

Default = F. Used to force facet label for single scenario which is usually dropped.

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

A list of maps