poccs_selectOccs Remove occurrences outside of polygon
poccs_selectOccs.Rd
This function removes occurrences outside of a user created polygon.
Arguments
- occs
data frame of cleaned occurrences obtained from component occs: Obtain occurrence data.
- polySelXY
matrix of longitude and latitude describing the expert drawn polygon.
- polySelID
numeric. Polygon ID to be used in SpatialPolygons creation, defaults to 1.
- logger
Stores all notification messages to be displayed in the Log Window of Wallace GUI. Insert the logger reactive list here for running in shiny, otherwise leave the default NULL.
- spN
data frame of cleaned occurrences obtained from component occs: Obtain occurrence data. Used to obtain species name for logger messages.
Value
A new occurence dataframe including only occurences inside the provided polygon and mantaining all columns from original dataframe for further analyses.
Details
This function is called by the select occurrences on map module. It allows for removal of occurrences outside the user drawn polygon in the map. The function will return a data frame of occurrences with all relevant columns for further analyses and without the occurrences outside of the polygon.
Examples
occs <- read.csv(system.file("extdata/Bassaricyon_neblina.csv",
package = "wallace"))[, 2:3]
occs$occID <- 1:nrow(occs)
longitude <- c(-71.58400, -78.81300, -79.34034, -69.83331,
-66.47149, -66.71319, -71.11931)
latitude <- c(13.18379, 7.52315, 0.93105, -1.70167,
0.98391, 6.09208, 12.74980)
expertAddedPoly <- matrix(c(longitude, latitude), byrow = FALSE, ncol = 2)
out.occs <- poccs_selectOccs(occs, polySelXY = expertAddedPoly,
polySelID = 1)
#> Removing occurrence(s) with occID = c(1, 5, 11, 12, 13, 14, 15). Updated data has n = 11 records.