mapgrid {bdvis}R Documentation

Maps the data points on the map in grid format

Description

Customizable grid-based spatial representation of the coordinates of the records in the data set.

Usage

mapgrid(
  indf = NA,
  comp = NULL,
  ptype = "records",
  title = "",
  bbox = NA,
  legscale = 0,
  collow = "blue",
  colhigh = "red",
  mapdatabase = "world",
  region = ".",
  shp = NA,
  gridscale = 1,
  customize = NULL
)

Arguments

indf

input data frame containing biodiversity data set

comp

Completeness matrix generate by function bdcomplete

ptype

Type of map on the grid. Accepted values are "presence" for presence/absence maps, "records" for record-density map, "species" for species-density map and "complete" for completeness map

title

title for the map. There is no default title

bbox

bounding box for the map in format c(xmin,xmax,ymin,ymax)

legscale

Set legend scale to a higher value than the max value in the data

collow

Color for lower range in the color ramp of the grid

colhigh

Color for higher range in the color ramp of the grid

mapdatabase

database to be used. By default, the world database is used

region

Specific region(s) to map, like countries. Default is the whole world map

shp

path to shapefile to load as basemap (default NA)

gridscale

plot the map grids at scale specified. Scale needs to specified in decimal degrees. Default is 1 degree which is approximately 100km.

customize

additional customization string to customize the map output using ggplot2 parameters

Details

This function builds a grid map colored according to the density of records in each cell. Grids are 1-degree cells, build with the getcellid function. Currently, four types of maps can be rendered. Presence maps show only if the cell is populated or not, without paying attention to how many records or species are present. Record-density maps apply a color gradient according to the number of records in the cell, regardless of the number of species they represent. Species-density maps apply a color gradient according to the number of different species in the cell, regardless of how many records there are for each one of those. Completeness maps apply a color gradient according to the completeness index, from 0 (incomplete) to 1 (complete).

See parameter descriptions for ways of customizing the map.

See Also

Other Spatial visualizations: bdwebmap()

Examples

## Not run: 
mapgrid(inat,ptype="records", region="India")

## End(Not run)

[Package bdvis version 0.2.28 Index]