ts.layer.temperature {rLakeAnalyzer} | R Documentation |
Calculate volume-weighted average water temperature across a range of depths for a timeseries.
Description
Function for simplifying the calculation of Wedderburn Number. Can usually
be called directly on data loaded directly using load.ts
and
load.bathy
.
Usage
ts.layer.temperature(wtr, top, bottom, bathy, na.rm = FALSE)
Arguments
wtr |
A data frame of water temperatures (in Celsius). Loaded using
|
top |
Either a single numeric depth value to be used across the entire
timeseries, or a vector of same length as the timeseries (e.g.,
|
bottom |
Either a single numeric depth value to be used across the
entire timeseries, or a vector of same length as the timeseries (e.g.,
|
bathy |
A data frame containing hypsometric data. Loaded using
|
na.rm |
Boolean indicated if step-by-step removal of NA's should be tried. If false, a timestep with any NA values will return an NA value. If true, best effort will be made to calculate indices despite NA values. |
Value
Returns a data frame with the timeseries of the average layer temperature. Includes ‘datetime’ and ‘layer.temp’ columns.
See Also
layer.temperature
Examples
#Get the path for the package example file included
wtr.path <- system.file('extdata', 'Sparkling.daily.wtr', package="rLakeAnalyzer")
bathy.path <- system.file('extdata', 'Sparkling.bth', package="rLakeAnalyzer")
#Load data for example lake, Sparkilng lake, in Wisconsin.
sp.wtr = load.ts(wtr.path)
sp.bathy = load.bathy(bathy.path)
l.t = ts.layer.temperature(sp.wtr, 0, 18, sp.bathy)
plot(l.t$datetime, l.t$layer.temp, type='l',
ylab='Volumetrically averaged lake temperature', xlab='Date')