Learn R Programming

letsR (version 1.0)

lets.addpoly: Add polygon values to a PresenceAbscence object

Description

Add polygon values to a PresenceAbsence object.

Usage

lets.addpoly(x, y, z, onlyvar=F)

Arguments

x
A PresenceAbsence object.
y
Polygon values to add.
z
Column name of where is located the polygon names to be used.
onlyvar
If TRUE only the matrix object will be returned.

Value

  • The result is a presence-absence matrix of species with the polygons names added as columns at the right-end of the matrix . The Values represent the percentage of the cell covered by the polygon.

See Also

lets.presab.birds lets.presab lets.addvar

Examples

Run this code
data(PAM)  # Phyllomedusa presence-absence matrix
data(wrld_simpl)  # World map
Brazil <- wrld_simpl[wrld_simpl$NAME=="Brazil", ]  # Brazil (polygon)

# Check where is the variable name (in this case it is in "NAME" which will be my z value)
names(Brazil)

PAM_pol <- lets.addpoly(PAM, Brazil, "NAME")

Run the code above in your browser using DataLab