View source: R/plot_transects.R
| plot_transects | R Documentation |
This function allows to plot the created transects transect_obj on the study area map_obj.map_obj must be a sf data.frame. If the transects are cut in multiple segments, the ifsegs argument allows to highlight with different colors the differents segment of the transect.
plot_transects(transect_obj, map_obj, crs, ifsegs = FALSE)
transect_obj |
sf dataframe. Transect/segment data. |
map_obj |
sf dataframe or Region object from dssd. Study region. |
crs |
Numeric. Projection system |
ifsegs |
Boolean. TRUE to highlight the different segments with colors. By default FALSE. |
ggplot object. The transects represented on the study area.
library(dssd)
library(dsims)
data(dataset_transects)
data(dataset_segs)
data(dataset_map)
# Use of the St Andrews bay map from the dssd package
shapefile.name <- system.file("extdata", "StAndrew.shp", package = "dssd")
# Creation of the object with the make.region function of the dsims package
region <- make.region(region.name = "St Andrews bay",
shape = shapefile.name,
units = "m")
# Plot transects
plot_transects(transect_obj = dataset_transects,
map_obj = region,
crs = 2154)
# Vizualize segment
plot_transects(transect_obj = dataset_segs,
map_obj = dataset_map,
crs = 2154,
ifsegs = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.