Learn R Programming

LakeMetabolizer (version 1.5.5)

metab.ols: Metabolism model based on a ordinary least squares parameter estimation framework.

Description

This function runs the ordinary least squares metabolism model on the supplied gas concentration and other supporting data. This is a common approach that allows for the concurrent estimation of metabolism paramters from a timeseries.

Usage

metab.ols(do.obs, do.sat, k.gas, z.mix, irr, wtr, ...)

Value

A data.frame with columns corresponding to components of metabolism

GPP

numeric estimate of Gross Primary Production, \(mg O_2 L^{-1} d^{-1}\)

R

numeric estimate of Respiration, \(mg O_2 L^{-1} d^{-1}\)

NEP

numeric estimate of Net Ecosystem production, \(mg O_2 L^{-1} d^{-1}\)

Arguments

do.obs

Vector of dissolved oxygen concentration observations, mg L^-1

do.sat

Vector of dissolved oxygen saturation values based on water temperature. Calculate using o2.at.sat

k.gas

Vector of kGAS values calculated from any of the gas flux models (e.g., k.cole) and converted to kGAS using k600.2.kGAS

z.mix

Vector of mixed-layer depths in meters. To calculate, see ts.meta.depths

irr

Vector of photosynthetically active radiation in \(\mu mol\ m^{-2} s^{-1}\)

wtr

Vector of water temperatures in \(^{\circ}C\). Used in scaling respiration with temperature

...

additional arguments; currently "datetime" is the only recognized argument passed through ...

Author

Luke A Winslow, Ryan Batt, GLEON Fellows

See Also

metab, metab.bookkeep, metab.mle, metab.kalman, metab.bayesian,

Examples

Run this code
library(rLakeAnalyzer)
doobs = load.ts(system.file('extdata', 
                           'sparkling.doobs', package="LakeMetabolizer"))
wtr = load.ts(system.file('extdata', 
                         'sparkling.wtr', package="LakeMetabolizer"))
wnd = load.ts(system.file('extdata', 
                         'sparkling.wnd', package="LakeMetabolizer"))
irr = load.ts(system.file('extdata', 
                         'sparkling.par', package="LakeMetabolizer"))

#Subset a day
mod.date = as.POSIXct('2009-07-08')
doobs = doobs[trunc(doobs$datetime, 'day') == mod.date, ]
wtr = wtr[trunc(wtr$datetime, 'day') == mod.date, ]
wnd = wnd[trunc(wnd$datetime, 'day') == mod.date, ]
irr = irr[trunc(irr$datetime, 'day') == mod.date, ]
z.mix = ts.thermo.depth(wtr)

k600 = k.cole.base(wnd[,2])
k.gas = k600.2.kGAS.base(k600, wtr[,3], 'O2')
do.sat = o2.at.sat.base(wtr[,3], altitude=300)

metab.ols(doobs[,2], do.sat, k.gas, z.mix[,2], irr[,2], wtr[,3])

Run the code above in your browser using DataLab