plot_transects: Plot transect

View source: R/plot_transects.R

plot_transectsR Documentation

Plot transect

Description

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.

Usage

plot_transects(transect_obj, map_obj, crs, ifsegs = FALSE)

Arguments

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.

Value

ggplot object. The transects represented on the study area.

Examples


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)


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