ConvertFrameDepth: MMR frame/depth conversion helper function

Usage Arguments Details Value Author(s) Examples

Usage

1
2
ConvertFrameDepth(data, tube.length = 1, tube.angle = NULL,
  frame_length = 0.675, max.frames = 100)

Arguments

data

Input dataframe. See 'details'.

tube.length

Length of the MMR tube, in meters. Defauls to 1.

tube.angle

Angle of tube install, relative to vertical. See 'details'.

max.frames

Maximum number of frames in a full tube depth.

frame.length

Length of a frame, in centimeters.

Details

The default frame length here is from a particular MMR manufacturer's technical specifications.

'tube.angle' is given as degrees relative to the vertical - must be the same length as unique tube identifiers in the dataset, and each identifier is matched according to sort. Units are in degrees and converted to radians for passing to R internal trig functions.

Value

Returns the original dataframe with new 'real.depth' and 'tube.depth' columns, the former being the actual soil depth of the measurement oint and 'tube'depth' being the relative depth along the length of the tube, both in meters.

Units of 'depth' are in centimeters.

Author(s)

Brandon McNellis

Examples

1
2
3
4
5
6
7
data <- read.table("SDEF_2016_RootLengths.txt", sep='\t', header=TRUE)
test.data <- data
test.data$date <- as.character(test.data$date)
test.data$date <- as.Date(test.data$date, format="%m/%d/%Y")
test.data <- ConvertFrameDepth(test.data)
plot(data$frame, test.data$depth)
# Should be 1:1 correspondence between frame # and depth in the new dataframe

bmcnellis/SDEF.analysis documentation built on June 4, 2019, 10 a.m.