sdm_tidy: Convert a 'SDM_area' object to a dataframe.

View source: R/sdm_tidy.R

sdm_tidyR Documentation

Convert a SDM_area object to a dataframe.

Description

Convert a SDM_area object to a dataframe.

Usage

sdm_tidy(an_area, region = NULL)

Arguments

an_area

A SDM_area object representing the area of the study.

region

An attribute used to join the primitive shapes to information about study area. If it is equal to NULL, the information about study area is dropped from the resulting dataframe.

Value

The SDM_area object converted to a dataframe. The dataframe is composed by attributes of the primitive shapes (polygons or lines) in an object of package sp (https://cran.r-project.org/web/packages/sp) and the information about study area.

Examples

## Not run: 
SPDF <- readOGR(
   system.file("vect_files/brasil_uf.gpkg", package="sdmTools"),
   layer = "brasil_uf",
   verbose = F
)

gridded_area <- SPDF %>%
 sdm_area("Test area", "EPSG:6933", c(50000, 50000)) %>%
 make_grid(var_names = list(), new_name = T)

a_df <- gridded_area %>%
   sdm_tidy(region = "cell_id")

a_df %>%
   head(20)

## End(Not run)

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