threshold_at_timespan: Find threshold at timespan

View source: R/threshold_at_timespan.R

threshold_at_timespanR Documentation

Find threshold at timespan

Description

This function finds the threshold of light for a given timespan. This function is the inverse of tat.

Usage

threshold_at_timespan(
  lightVar,
  timespan,
  sampling_int = NULL,
  above = TRUE,
  as_df = TRUE,
  wide = TRUE
)

Arguments

lightVar

Numeric vector containing the light data.

timespan

Single value or vector specifying the timespan(s). Can be numeric or string in the format "[numeric] [unit]", with possible units ("seconds","minutes", "hours","days"). Units can be abbreviated, see parse_timeunit_tosecs. If numeric, no time scaling will be performed.

sampling_int

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

above

Logical. Should the threshold of the timespan at which the light is above the threshold be calculated? Defaults to TRUE. If FALSE, the threshold of the timespan at which the light is below the threshold is calculated.

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.

Value

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


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