map.res: Mapping in grid cell results of IUCN.eval

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/IUCNeval.functionv11.R

Description

Provides four maps showing in grid cells of a given resolution : number of records, species richness, number of threatened species (CR+EN+VU) and proportion of threatened species. Based on quilt.plot.

Usage

1
2
3
map.res(Results, Occurrences, country_map=NULL, Resol=1, threshold=0, 
	LatMin=NULL, LatMax=NULL, LongMin=NULL, 
	LongMax=NULL, export_map=FALSE, file_name=NULL, export_data=FALSE)

Arguments

Results

The default output of IUCN.eval applied to multiple species

Occurrences

A dataframe, see Details

country_map

A SpatialPolygonsDataFrame or SpatialPolygons showing for example countries or continent borders

Resol

numeric , resolution in decimal degrees

threshold

numeric, only grid cells with at least this number of records will be shown

LatMin

numeric, minimum latitude for the map

LatMax

numeric, maximum latitude for the map

LongMin

numeric, minimum longitude for the map

LongMax

numeric, maximum longitude for the map

export_map

logical, if TRUE, four maps in png will be created in the working directory if FALSE, maps will be displayed in the R session

file_name

character string. Name of the file

export_data

logical. If TRUE, a dataframe containing all information on the grid cell mapped is exported

Details

Input Occurrences as a dataframe should have the following structure:

It is mandatory to respect field positions, but field names do not matter

[,1] ddlat numeric, latitude (in decimal degrees)
[,2] ddlon numeric, longitude (in decimal degrees)
[,3] tax character or factor, taxa names

Value

Produce four maps either in the R session (if export_map is FALSE) or in png format in the working directory (if export_map is TRUE)

If export_data is TRUE

Output

[,1] X numeric, x coordinates of cell [,2] Y numeric, y coordinates of cell [,3] meanLat numeric, mean latitude of occurrences within cell
[,4] meanLat numeric, mean longitude of occurrences within cell
[,5] NbeRec numeric, Number of records
[,6] NbeEsp numeric, Number of species
[,7] NbeThreatened numeric, Number of threatened species
[,8] PropThreatened numeric, Proportion of threatened species

Author(s)

Gilles Dauby

See Also

package fields function quilt.plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
## Not run: 
data(land)
data(Malagasy_amphibian)
Results <- IUCN.eval(Malagasy_amphibian, DrawMap=FALSE, country_map=land, SubPop=FALSE)
### This should run for 3 to 6 minutes depending of the computer.

### Maps covering the whole dataset with a minimum of 5 records in each cell
map.res(Results=Results, Occurrences=Malagasy_amphibian, country_map=land, 
export_map=FALSE, threshold=5)

## Maps focusing on Madagascar with a minimum of 5 records in each cell
map.res(Results=Results, Occurrences=Malagasy_amphibian, country_map=land, export_map=FALSE, 
	threshold=5, LatMin=-25,LatMax=-12,LongMin=42, LongMax=52)

## Maps focusing on Madagascar at half degree resolution with a minimum of 5 records in each cell
map.res(Results=Results, Occurrences=Malagasy_amphibian, country_map=land, 
export_map=FALSE,Resol=0.5, 
	threshold=5, LatMin=-25,LatMax=-12,LongMin=42, LongMax=52)

## Maps have been exported in the directory IUCN__results_map
map.res(Results=Results, Occurrences=Malagasy_amphibian, country_map=land, export_map=TRUE, 
	threshold=5, LatMin=-25,LatMax=-12,LongMin=42, LongMax=52)

## Install speciesgeocodeR package for an example with their lemurs dataset
library(speciesgeocodeR)
data("lemurs_in")

Results <- IUCN.eval(lemurs_in, DrawMap=FALSE, country_map=land, SubPop=FALSE)

map.res(Results=Results, Occurrences=lemurs_in, country_map=land, export_map=FALSE, threshold=3, 
	LatMin=-25,LatMax=-12,LongMin=42, LongMax=52, Resol=1)


## End(Not run)

ConR documentation built on Oct. 30, 2019, 11:30 a.m.