View source: R/crop_transect.R
| crop_transect | R Documentation | 
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.
crop_transect(transect_obj, map_obj, ifsegs = FALSE)
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.  | 
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.
sf dataframe. The transect resize to match the density map grid.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.