Learn R Programming

rangeMapper (version 2.0.3)

st_thin: Thinning of polygonal grids

Description

Nearest neighbours spatial thinning of polygonal grids

Usage

st_thin(x, lag)

Value

a thinned sf::st_as_sf() object.

Arguments

x

an sf data.frame.

lag

lag order.

References

Based on SO answer: https://stackoverflow.com/questions/65907022/

Examples

Run this code
if (FALSE) {
require(rangeMapper)
con = rmap_connect()
wrens = read_wrens()
rmap_add_ranges(con, x = wrens, ID = 'sci_name')
rmap_prepare(con, 'hex', cellsize=500)
rmap_save_map(con) 
x = rmap_to_sf(con)[, 'cell_id']

plot( st_thin(x,2) )

x = x[ ! x$cell_id  %in%  c(282,265) , ]

plot( st_thin(x,3) )

}

Run the code above in your browser using DataLab