mldthermocline: Calculate the mixed depth using the presence of a thermocline

Description Usage Arguments Value Author(s) Examples

Description

Here you get to define your own reference depth and temperature difference to determine where the mixed layer ends based on the slope of each linear regression between each consecutive depth point pair. This function will return the the bottom depth that does fit the condition; it does not return most shallow depth which no longer fits the mixed layer condition. This function doesn't care about units, so you are responsible for your own. Also note that this function will return a thermocline depth even for inverted profiles (surface temperature colder than depth), although it will print a warning for you as well.

If you data is in excel, be sure to download the file into a dataframe, then open that dataframe to figure out the names of the columns you are interested in or rename columns. This will be easiest with a worksheet that only contains columns of data. Ex:

library(gdata)

mydata = read.xls("mydata.xls") #Reads from the first sheet only

Usage

1
mldthermocline(df, depthname, tempname)

Arguments

df

Data frame which has one column for depth and another column for temperatures. Can contain additional columns. See the example below for help on assembling a dataframe from two vectors or lists.

depthname

The name of the df column that contains depth data, input as a string (i.e., 'depth' not depth.)

tempname

The name of the df column that contains temperature data, input as a string (i.e., 'temp' not temp.)

Value

Returns a sungle numeric value that is the minimum of the depths you provided that still is part of the mixed layer.

Author(s)

Kate Evans, University of Montana/Flathead Lake Biological Station

Examples

1
2
3
4
5
6
#6 temperature points at 6 different depths
depth <- c(0, 1, 2, 3, 4, 5)
temps <- c(10, 10, 10, 5, 0, 0)
df <- data.frame(depth, temps)
names(df) <- c('depths', 'temps')
mldthermocline(df, 'depths', 'temps')

kevans27/aqeco documentation built on May 16, 2019, 4:08 a.m.