wave.dur: Find the proportion of time when water surface is near a...

Description Usage Arguments Value Examples

View source: R/waveDur.R

Description

Find the proportion of time when water surface is near a selected elevation

Usage

1
wave.dur(level, elevation, buffer = 0.050)

Arguments

level

a numeric vector of water levels

elevation

elevation(s) of interest (e.g., marsh platform, MHW). A vector of elevations is accepted. Elevation should be in the same vertical datum as level and have units of meters

buffer

the vertical range used to calculate exposure. Default is 0.050 meters (5 cm)

Value

a vector of values representing the fraction of time in the entire dataset where the water surface is near the elevation of interest. Numerical range is from 0-1. NAs are omitted.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(NL_6min_2013)

### an elevation of interest: 0.9117 m
MHW <- 0.9117

wave.dur(NL_6min_2013[, 2], MHW)

## Not run: 
### function also accepts and returns vectors
elevs           <- data.frame(elevs = c(-1000:1500) / 10^3)
elevs$wave.dur  <- wave.dur(NL_6min_2013[, 2], elevs$elevs)
plot(elevs ~ wave.dur, data = elevs)

## End(Not run)

troyhill/VulnToolkit documentation built on Aug. 10, 2021, 10:55 a.m.