fld.frq: Flooding frequency

Description Usage Arguments Details Value See Also Examples

View source: R/fld_frq.R

Description

Calculates the frequency of high tides flooding an elevation of interest.

Usage

1
fld.frq(z, ht, units = "percent")

Arguments

z

elevation of interest

ht

a numeric vector of high tide levels

units

units for output. Default is percent; the proportion of tides flooding elevation x. Alternatively, tides will return the number of flooding tides in the dataset

Details

Calculates the frequency of high tides flooding an elevation of interest.

Value

value the number or percent of high tides in vec that fall above z

See Also

fld.dur

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# get a dataset of high/low tides
HT.NL <- HL(level = NL_6min_2013[, 2], time = NL_6min_2013[, 1], tides = "H")
a <- fld.frq(z = 0.9117, ht = HT.NL[, 1], units = "tides") # number of flooding tides at MHW
a / length(HT.NL[, 1]) # flooding tides as a percentage of all tides in time period

fld.frq(0.9117, HT.NL[,1], units = "percent") # check 

b <- as.numeric((NL_6min_2013[nrow(NL_6min_2013), 1] - 
NL_6min_2013[1, 1])) / 365.242 # fraction of year covered by dataset

elev.frq <- data.frame(elev = seq(from = 0, to = 1.5, by = 0.005))

# error thrown if units = "tides" and length(x) > length(ht)
fld.frq(elev.frq$elev, HT.NL[, 1], units = "tides") 

# a work-around
elev.frq$frq <- fld.frq(elev.frq$elev, HT.NL[, 1], units = "percent") * 
length(HT.NL[, 1]) / b 

plot(elev.frq$frq ~ elev.frq$elev, pch = 19, 
ylab = "flooding frequency (tides per year)", xlab = "elevation (m; MLLW)")

VulnToolkit documentation built on Aug. 2, 2021, 5:07 p.m.