if (FALSE) {
# Give me a compacted representation of County Ashe, NC
nc <- sf::st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)
nc1 <- nc[1, ]
nc1 <- sf::st_cast(nc1, 'POLYGON')
fillers <- polygon_to_cells(geometry = nc1, res = 6)
compacted <- compact(fillers)
}
Run the code above in your browser using DataLab