extract_max_cor: Extract Maximum Correlation Value

View source: R/10-extract_data.R

extract_max_corR Documentation

Extract Maximum Correlation Value

Description

Retrieves the maximum correlation value from the all_cor attribute of the given object and provides the associated shift time as the name of the value.

Usage

extract_max_cor(object)

Arguments

object

An object that includes all_cor and shift_time attributes.

Details

The function selects the maximum value from the all_cor attribute, which is a vector of correlation coefficients. It then matches this maximum value with its corresponding shift time from the shift_time attribute. This shift time becomes the name of the returned value, allowing for easy identification of when the maximum correlation occurs.

Value

A single named element. The name is the shift time associated with the maximum correlation value in the all_cor attribute of the object.

Note

The object is expected to have an all_cor attribute that contains correlation values and a shift_time attribute that contains the corresponding shift times. This function simplifies the process of identifying the point in time with the highest correlation coefficient.

Examples

data("object", package = "laggedcor")
extract_max_cor(object = object)

jaspershen/laggedcor documentation built on Nov. 9, 2023, 3:44 p.m.