crop_transect: Crop transect

View source: R/crop_transect.R

crop_transectR Documentation

Crop transect

Description

This function allows to resize the transects transect_obj created with the create_transect function, in order to perfectly fit the density map use to simulate individuals map_obj.

Usage

crop_transect(transect_obj, map_obj, ifsegs = FALSE)

Arguments

transect_obj

sf dataframe. The transect data.

map_obj

sf dataframe. Map of the study area with the density.

ifsegs

Boolean. TRUE to highlight the different segments with colors. By default FALSE.

Details

An improvement that should come later consit in having a grid matching perfectly with the study region region_obj or density_obj. For the moment, the grid created with extract_map does not perfectly match the total area of the region because it only keeps squares of the same size, so the edges of the study region are slightly cropped. With the create_transect function, the transects are created on the basis of the total region region_obj and not on the basis of the grid map_obj. Hence the need to resize with the fonction crop_transect.

Value

sf dataframe. The transect resize to match the density map grid.

Examples


data(dataset_transects)
data(dataset_map)

# The transects do not correspond perfectly to the density map
plot_transects(transect_obj = dataset_transects, 
               map_obj = dataset_map, 
               crs = 2154)

# Crop transects
cropped_transects <- crop_transect(transect_obj = dataset_transects,
                                   map_obj = dataset_map)

# The transects correspond perfectly to the density map
plot_transects(transect_obj = cropped_transects, 
               map_obj = dataset_map, 
               crs = 2154)


maudqueroue/intercali documentation built on Oct. 8, 2022, 2:09 p.m.