tatx: Time above/below threshold or within threshold range

tatxR Documentation

Time above/below threshold or within threshold range

Description

These functions calculate the duration above/below a specified threshold intensity or within a specified intensity range, within the time series provided.

Usage

tat(
  lightVar,
  threshold,
  sampling_int = NULL,
  unit_out = NULL,
  as_df = TRUE,
  wide = TRUE
)

tatr(
  lightVar,
  lower,
  upper,
  sampling_int = NULL,
  unit_out = NULL,
  as_df = TRUE,
  wide = TRUE
)

Arguments

lightVar

Numeric vector containing the light data.

threshold

Single numeric value or vector specifying threshold intensities. The sign indicates above/below (see threshold).

sampling_int

Numeric. Sampling interval in seconds. If not specified (default), no time scaling will be performed.

unit_out

Character. Time unit of output. Possible values are ("seconds", "minutes", "hours", "days"), which can be abbreviated. If not specified (default), no time scaling will be performed.

as_df

Logical. Should the output be returned as a data frame? Defaults to TRUE.

wide

Logical. Should the output be returned in wide format? Defaults to TRUE.

lower

Single numeric value or vector specifying the lower bound of the threshold intensity range. The sign indicates above/below (see threshold). Must be same length as upper bound.

upper

Single numeric value or vector specifying the upper bound of the threshold intensity range. The sign indicates above/below (see threshold). Must be same length as lower bound.

Details

'tat()' calculates the time above/below threshold.

'tatr()' calculates the time within threshold range.

Value

Data frame or matrix with pairs of threshold and calculated values. If wide is TRUE then variable names will be concatenated with the threshold.


steffenhartmeyer/lightdosimetry documentation built on Jan. 29, 2024, 12:48 p.m.