elimCellDups | R Documentation |
This function thins spatial points such that no more than one point falls within each cell of a reference raster. If more than one point falls in a cell, the first point in the input data is retained unless the user specifies a priority for keeping points.
elimCellDups(x, rast, longLat = NULL, priority = NULL)
x |
Points. This can be either a |
rast |
|
longLat |
Two-element character list or two-element integer list. If |
priority |
Either |
Object of class x
.
x <- data.frame( long=c(-90.1, -90.1, -90.2, 20), lat=c(38, 38, 38, 38), point=letters[1:4] ) rast <- raster::raster() # empty raster covering entire world with 1-degree resolution elimCellDups(x, rast, longLat=c(1, 2)) elimCellDups(x, rast, longLat=c(1, 2), priority=c(3, 2, 1, 0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.