time_at_events: time at maximum/minimum

Description Usage Arguments Details Value Functions Examples

Description

helpers for sfn_metrics

Usage

1
2
3

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

1
2
3
4
5
6
7
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))

sapfluxnetr documentation built on Oct. 4, 2021, 9:06 a.m.