make_grid: Make a grid over a study area.

View source: R/make_grid.R

make_gridR Documentation

Make a grid over a study area.

Description

Make a grid over a study area.

Usage

make_grid(an_area = NULL, var_names = NULL, new_name = NULL, dir_path = NULL)

Arguments

an_area

A SDM_area object representing the area of the study.

var_names

A list of variable names to keep on cells. It try to match each variable name (ignoring case and partially matched) in the study area. Variables are calculated using the average of features (polygons or lines) coverage by each cell.

new_name

A name to new area study after make a grid over area.

centroid

A boolean indicating if x_centroid and y_centroid variables must be computed and appended

Value

A SDM_area object with cells covering the study area. The dataframe contains the variables matched and computed acoording to each cell.

Examples

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

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

plot(gridded_area)

gridded_area <- SLDF %>%
  sdm_area("Test area", "EPSG:6933", c(10000, 10000)) %>%
  make_grid(var_names = list("Length", "xxx", "Main_ri"))

plot(gridded_area)

## End(Not run)

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