Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion R/extrema.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#' artificial extrema added to the ends of the data as specified in the
#' original EEMD article [1]. In the case of flat regions at the extrema, the center point of the flat region
#' will be considered the extremal point [2].
#'
#' Added support for xts objects, Chuck Coleman, December 3, 2021.
#'
#' @export
#' @name extrema
Expand Down Expand Up @@ -38,7 +40,7 @@
#'
extrema <- function(input) {
output <- extremaR(input)
if (inherits(input, "ts")) {
if (inherits(input, c("ts","xts"))) {
output$x_max <- time(input)[output$x_max + 1]
output$x_min <- time(input)[output$x_min + 1]
}
Expand Down