View source: R/polygonTrimmer.R
polygonTrimmer | R Documentation |
This function takes a list of polygons as from densityMapToPolygons() or similar and removes portions of the polygons based off of their overlaps.
polygonTrimmer(polygonList, namesList, crs = "+proj=longlat +ellps=WGS84")
polygonList |
A list of polygons to check |
namesList |
The subspecies (or other) names associated with polygon list |
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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.