lets.addpoly: Add polygon coverage to a PresenceAbscence object

Description Usage Arguments Value Author(s) See Also Examples

View source: R/lets_addpoly.R

Description

Add polygon coverage within cells of a PresenceAbsence object.

Usage

1
lets.addpoly(x, y, z, onlyvar = FALSE)

Arguments

x

A PresenceAbsence object.

y

Polygon of interest.

z

A character indicating the column name of the polygon containing the attributes 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' attributes used added as columns at the right-end of the matrix. The Values represent the percentage of the cell covered by the polygon attribute used.

Author(s)

Bruno Vilela

See Also

lets.presab.birds

lets.presab

lets.addvar

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
data(PAM)  # Phyllomedusa presence-absence matrix
require(maptools)
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")

## End(Not run)

letsR documentation built on Oct. 27, 2020, 1:07 a.m.