keep_areas_gt: Drop non-contiguous polygons with area smaller or equal...

View source: R/keep_areas_gt.R

keep_areas_gtR Documentation

Drop non-contiguous polygons with area smaller or equal lower_bound.

Description

Drop non-contiguous polygons with area smaller or equal lower_bound.

Usage

keep_areas_gt(
  an_area = NULL,
  lower_bound = 0,
  new_name = NULL,
  dir_path = NULL
)

Arguments

an_area

A SDM_area object representing the area of study.

lower_bound

A lower bound area indicating polygons which it going to dropped out.

new_name

A name to new area study after dropping smaller polygons.

Value

A SDM_area containing an object of package sp (https://cran.r-project.org/web/packages/sp) with remaining disaggregated polygons with area greater than lower_bound.

Examples

## Not run: 
new_SPDF <- SP %>%
 as("SpatialPolygonsDataFrame")
new_SPDF@data <- list(
 area=c(
   SP[1] %>% gArea(),
   SP[2] %>% gArea(),
   SP[3] %>% gArea()
 )
) %>%
 as.data.frame()

plot(new_SPDF)

new_area <- new_SPDF %>%
 sdm_area(
    "Removing a single area from a SpatialPolygons study area.",
    "EPSG:6933",
    c(50000, 50000)
 ) %>%
 keep_areas_gt(
    0.25,
    new_name = "Removing a single area from a SpatialPolygons study area."
 )

plot(new_area$study_area)

## End(Not run)

reginaldo-re/sdmTools documentation built on April 25, 2022, 8:08 p.m.