martincurveb: Calculate the particle flux attenuation constant via the...

Description Usage Arguments Value Author(s) Examples

Description

Solves for b according to:

fz = fz0*(z/z0)^(-b)

Intakes two vectors: depths and flux and optional reference depths and target depths. The function will return 5 variables, in order: min, max, mean, median, allvals

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
martincurveb(des, flu, rds, tds)

Arguments

des

Vector that contains all depth data. Needs to be the same length as "fluxes".

flu

Vector that contains all flux data. Needs to be the same length as "depth".

rds

Optional specific reference depth data. Can be a single value or vector. If you include rds, you need to also include tds.

tds

Optional specific target depth data. Can be a single value or vector. If you include tds, you need to also include rds.

Value

Returns a list of five values: "Minimum" b value, "Maximum", "Mean", "Median", and "AllVals" (which is all calculated b values).

Minimum

Single numeric minimum b value

Maximum

Single numeric maximum b value

Mean/Average

Single numeric mean b value

Median

Single numeric median b value

AllVals

List of all numeric calculated b values

Author(s)

Kate Evans, University of Montana/Flathead Lake Biological Station

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#Samples taken from 3 depths with two samples each.
#Checking all samples against any deeper samples.
depth <- c(150, 150, 300, 300, 500, 500)
flux <- c(500, 480, 340, 300, 240, 250)
martincurveb(depth, flux)

#Same samples as above (3 depths with two samples each),
#but only comparing the shallowest depth against the two deeper groups.
depth <- c(150, 150, 300, 300, 500, 500)
flux <- c(500, 480, 340, 300, 240, 250)
martincurveb(depth, flux, rds = c(300, 500), tds = 150)

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