Last data update: 2014.03.03

R: Diversity heatmap
mapDiversityR Documentation

Diversity heatmap

Description

This function will generate a diversity heatmap using presence/absence of species on grid cells.

Usage

mapDiversity(data, resolution = 1, plot = T, plot.with.grid = T, 
export = F, legend = T, filename = "diversity_map")

Arguments

data

data.frame

resolution

numeric, size of the grid cells (degrees)

plot

logical

plot.with.grid

logical, whether or not to add a grid to the plot

export

logical

legend

logical

filename

character

Details

It requires a data.frame with three columns, ordered as: species, longitude and latitude. The function will plot and return a raster object. The resolution of the grid can be changed by the argument "resolution" (in degrees). It uses functions of the package raster.

Value

A raster object.

Author(s)

Marcelo Reginato

See Also

raster

Examples


## loading the example data

data(monographaR_examples)
monographaR_examples$map_data -> data
head(data)

## running the function

mapDiversity(data , resolution=1, plot=TRUE, plot.with.grid=TRUE)

Results