time_at_events {sapfluxnetr}R Documentation

time at maximum/minimum

Description

helpers for sfn_metrics

Usage

max_time(x, time)

min_time(x, time)

Arguments

x

a numeric vector, usually a variable in the sapflow or environmental data.

time

a POSIXct or character vector with the TIMESTAMP values

Details

These helper functions return the TIMESTAMP value at which the maximum value for other variable occurs. It is designed to be used inside a dplyr summarise statement.

Value

a single value (POSIXct) with the TIMESTAMP value.

Functions

Examples

library(dplyr)
storms %>%
  group_by(year) %>%
  summarise(wind_max = max(wind),
            hour_at_max = sapfluxnetr:::max_time(wind, time = hour),
            wind_min = min(wind),
            hour_at_min = sapfluxnetr:::min_time(wind, time = hour))


[Package sapfluxnetr version 0.1.4 Index]