newVarsVect: New variable generator

View source: R/variables.R

newVarsVectR Documentation

New variable generator

Description

Function for generating the variables required to apply the filtering process. This function has been tested with tables extracted from the Integrated Marine Observing System (IMOS, Australia) freely available data, and it should work with any Sea-mammal Research Unit (SMRU, St. Andrews, Scotland) provided file. please contact the author if it does not work with your data to find a custom adaptation suitable for your data.

Usage

newVarsVect(Data = Data, t = FALSE)

Arguments

Data

an object of class 'data.frame' containing at least the Broken-stick output ([T1...T4], [D1...D4]), dive duration (DIVE_DUR)

t

Logical. wheter t1...t4 exist on the Data or not. If FALSE, they are computed

Details

Newly computed variables:

  • descspeed: initial descending speed (from surface to the 1 infl point)

  • ascspeed: last ascending speed (from the 4 infl point to the surface)

  • daratio: the ratio between both speeds

  • max.depth: maximum depth (it's duplicated but both names are required)

  • min.depth: minimum depth of the inflection points

  • max.time: time spend before reaching max.depth

  • avratio: Deviation of the max.depth point from the middle of the inflected dive

  • hp1: length of the first segment

  • hp2: length of the second segment

  • hp3: length of the third segment

  • Sa: for getting avratio

  • Sb: for getting avratio

  • d1: ratio between max.depth and the depth at the given inflection point (=1 if the given inflection point holds the max.depth). This calculates the first

  • d2: same ratio for the second inflection point

  • d3: same ratio for the third inflection point

  • d4: same ratio for the fourth inflection point

  • modres1: residual from a fitted linear model along the inflection points.Value for the first inflection point

  • modres2: for the second inflection point

  • modres3: for the third inflection point

  • modres4: for the fourth inflection point

  • propseg1: proportion of the dive along the first segment

  • propseg2: proportion of the dive along the second segment

  • propseg3: proportion of the dive along the third segment

Value

this function returns the provided dataset with newly added columns named as variables described above, with the calculations.


farcego/slimmingDive documentation built on April 14, 2024, 8:24 a.m.