Customizable grid-based spatial representation of the coordinates of the records in the data set.
mapgrid(
indf = NULL,
comp = NULL,
ptype = "records",
title = "",
bbox = NA,
legscale = 0,
collow = "blue",
colhigh = "red",
mapdatabase = NULL,
region = NULL,
shp = NA,
gridscale = 1,
customize = NULL
)
No return value, called for plotting the graph
input data frame containing biodiversity data set
Completeness matrix generate by function bdcomplete
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 for the map. There is no default title
bounding box for the map in format c(xmin,xmax,ymin,ymax)
Set legend scale to a higher value than the max value in the data
Color for lower range in the color ramp of the grid
Color for higher range in the color ramp of the grid
Parameter is deprecated
Parameter is deprecated. Please use shape files.
path to shapefile to load as basemap (default NA)
plot the map grids at scale specified. Scale needs to specified in decimal degrees. Default is 1 degree which is approximately 100km.
additional customization string to customize the map output using ggplot2 parameters
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.
if (FALSE) {
mapgrid(inat,ptype="records", region="India")
}
Run the code above in your browser using DataLab