ExtractVeg | R Documentation |
Merges the cleaned cross-shore profile dataset with vegetation data. Note that this function must be run before the wave evolution and erosion models can be run. Even if your project has no vegetation, running this function is still necessary to format the data frame with appropriate columns.
ExtractVeg(pt_exp = NA, Vegetation = NA)
pt_exp |
Cross-shore point elevations spatial points object returned from CleanTransect. |
Vegetation |
A simple feature polygon of class sf and dataframe. Patch attributes must include
|
An object of class sf and data.frame updated with vegetation data attributes and ready for the wave evolution and erosion model.
## Not run:
library(MNAI.CPBT)
data(Coastline)
# Generate cross-shore profile lines along the coastline.
crossshore_profiles <- samplePoints(
Coastline = Coastline,
ShorelinePointDist = 150,
BufferDist = 50,
RadLineDist = 1.5
)
crossshore_lines <- crossshore_profiles[[2]]
# Extract elevation values along each profile
rpath <- system.file("extdata", "TopoBathy.tif", package = "MNAI.CPBT")
TopoBathy <- raster::raster(rpath)
pt_elevs <- ExtractElev(crossshore_lines, TopoBathy)
# Run SignalSmooth function to smooth elevation profiles
pt_elevs <- SignalSmooth(point_elev = pt_elevs,
SmoothParameter = 5)
# Clean the cross-shore profiles with CleanTransect
cleantransect <- CleanTransect(
point_elev = pt_elevs,
RadLineDist = 1.5,
MaxOnshoreDist = 1,
trimline = NA
)
# Merge vegetation onto lines
data(Vegetation)
dat_veg <- ExtractVeg(pt_exp = cleantransect, Vegetation = Vegetation)
# Cross-shore profiles ready for modeling
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.