makeGROWmap: makeGROWmap

Description Usage Arguments Details Value Author(s) Examples

Description

makeGROWmap takes a dataset with values and a GROW column and makes a map in ggplot2. Code is modified and extended from @jebyrnes package meowR https://github.com/jebyrnes/meowR.

Usage

1
2
3
4
5
6
makeGROWmap(newdata, fillColName, regionColName = type, type = "ECOREGION",
  realm = "Marine", noAxisLabels = T, fillPal = brewer.pal(11,
  "Spectral"), pal = "Spectral", pathCol = "black", pathAlpha = 1,
  guide = guide_colourbar(title = fillColName), dataOut = FALSE,
  na.value = NA, add.worldmap = FALSE, fillAlphaColName = NULL,
  excludeNoDataAreas = T, prevggplot = NULL, ...)

Arguments

newdata

dataset to be used

fillColName

name of the column with information to be used for a fill value

regionColName

data name of column with ecoregion, province, or realm names

type

are these values from an ECOREGION, PROVINCE, or REALM map. Defaults to "ECOREGION". Note all caps.

realm

What geographic realm are the data from (Marine, Freshwater, Terrestrial, Hotspot, IPBES)?

noAxisLabels

Should axis labels for latitude and longitude be plotted. Defaults to TRUE

fillPal

The palatte used by scale_fill_gradientn. Defaults to brewer.pal(11, "Spectral")

pal

The palatte used by scale_fill_manual if data is categorical. Defaults to "spectral" from RColorBrewer

pathCol

The path color for regional outlines. Defaults to "black"

pathAlpha

The alpha of the regional outlines. Defaults to 1.

guide

What kind of guide should be used, and what should it's title be? Defaults to guide_colourbar(title=fillColName)

dataOut

Return a merged dataframe for plotting instead of a plot? Defaults to FALSE

na.value

How are NAs areas handled for fill? Defaults to making them not plot - NA.

add.worldmap

Should a map of the world be plotted under the regions? Defaults to FALSE

fillAlphaColName

Colname of column used to scale alpha level of fill

excludeNoDataAreas

Exclude areas/regions from the plot with no data?

prevggplot

A ggplot argument that this plot will be added on top of. If null, a new ggplot object is created.

...

Other arguments to be supplied to color scale

Details

makeGROWmap takes a dataset with values and a GROW column and makes a map in ggplot2

Value

Returns ggplot object

Author(s)

Sarah Supp.

Examples

1
2
3
4
5
6
data(regions.df)

ndf <- data.frame(Ecoregions = levels(regions.df$ECOREGION), 
Values = runif(length(levels(regions.df$ECOREGION)), 0,100))

makeGROWmap(ndf, fillColName="Values", regionColName="Ecoregions")

sarahsupp/growR documentation built on May 29, 2019, 1:50 p.m.