polygonTrimmer: Polygon Trimmer

View source: R/IdentifyBirdSubspecies.R

polygonTrimmerR Documentation

Polygon Trimmer

Description

This function takes a list of polygons as from densityMapToPolygons() or similar and removes portions of the polygons as determined by flagPolygonOverlap() and trimPolygonsByOverlap()

Usage

polygonTrimmer(polygonList, namesList)

Arguments

polygonList

A list of polygons to check

namesList

The subspecies (or other) names associated with polygon list

Examples


listFromSubspeciesOcc = subspeciesOccQuery(spp="Cardinalis sinuatus",
   subsppList=c("sinuatus","peninsulae","fulvescens"),pointLimit=100,
   dbToQuery="gbif")

labeledLoc = labelSubspecies(subsppOccList=listFromSubspeciesOcc)
locs = labeledLoc[labeledLoc$subspecies=="sinuatus",]
locs_sin = labeledLoc[labeledLoc$subspecies=="sinuatus",]
locs_ful = labeledLoc[labeledLoc$subspecies=="fulvescens",]
dens_sin = subspeciesDensityMap(localities=locs_sin,quant=0.95,
   xmin=-125,xmax=-60,ymin=10,ymax=50)
dens_ful = subspeciesDensityMap(localities=locs_ful,quant=0.95,
   xmin=-125,xmax=-60,ymin=10,ymax=50)
densPol_sin = densityMapToPolygons(densityMap=dens_sin)
densPol_ful = densityMapToPolygons(densityMap=dens_ful)
densityPolygons = list(sinuatus=densPol_sin,fulvescens=densPol_ful)
densityPolygons_trim = polygonTrimmer(polygonList=densityPolygons,
   namesList=c("sinuatus","fulvescens"))


kaiyaprovost/subsppLabelR documentation built on March 17, 2024, 5:09 p.m.