View source: R/subspeciesMatchChecker.R
subspeciesMatchChecker | R Documentation |
This function takes the locations of points relative to polygons from locatePolygonPoints() or similar and checks where points are assigned. Points that are in 1) no polygons, 2) multiple polygons, or 3) have a subspecies label that does not match their assignment are flagged as "suspect". Any points that are in single polygons and either 1) were originally unlabeled or 2) have a subspecies label that matches their assignment are flagged as "good".
subspeciesMatchChecker(locfile, subsppNames)
locfile |
Points with subspecies assignments and boolean locations with respect to polygons. |
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)
polyLocations = labeledLoc
polyLocations = locatePolygonPoints(test_points=polyLocations,polygonA=densPol_sin,polygonB=densPol_ful,crs="+proj=longlat +ellps=WGS84",setcoord = TRUE,nameA="sinuatus",nameB="fulvescens")
checked = subspeciesMatchChecker(locfile = polyLocations)
checked_suspect = checked$suspect
checked_good = checked$good
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.