segment: Segment a data frame based on a numeric vector

Description Usage Arguments Value

View source: R/segment.R

Description

Returns a data frame

Usage

1
segment(x, y, labels = NULL, func = mean)

Arguments

x

A matrix or data frame with numeric time series in each column

y

A numeric vector used to segment columns of x. Must be the same length as the columns of x

labels

A dataframe with factor label(s). Labels will be be added to each observation in the output dataframe.

func

A function to apply to each segment of each column.

Value

df A dataframe with each corresponds to the supplied function applied to the segmented data along with the label


nateaff/tssegment documentation built on Sept. 7, 2017, 12:26 a.m.