X_max: Estimated maximum of a time series

View source: R/Analyses_functions_1.R

X_maxR Documentation

Estimated maximum of a time series

Description

This function computes the maximum of a time series for the provided time interval or its sub-interval.

Usage

X_max(X, subI = NULL, plot = FALSE, vline = FALSE, hline = FALSE)

Arguments

X

Data frame where the first column is a numeric time sequence (t) and the second the values of the time series (X(t)).

subI

Time sub-interval is a vector where the lower bound is the first element and upper bound is the second. Optional: If provided maximum of the sub-interval is returned, otherwise the whole time sequence is considered.

plot

Logical: If TRUE, the time series, the maximum and corresponding t values are plotted in interactive sessions.

vline

Logical: If TRUE, a vertical line is plotted across the maximum.

hline

Logical: If TRUE, a horizontal line is plotted across the maximum.

Value

A list of numeric vector(s). The first element in the vector is the corresponding t value and second the maximum of the time series.

See Also

X_min

Examples

t <- seq(0, 1, length = 100)
TS <- data.frame("t" = t, "X(t)" = rnorm(100))
X_max(TS, subI = c(0.5, 0.8), plot = TRUE)


Rmfrac documentation built on Sept. 10, 2025, 10:31 a.m.