clusterAverages: calculates cluster averages

View source: R/clusterTools.R

clusterAveragesR Documentation

calculates cluster averages

Description

calculates average values and distributions for each cluster and time point of a time series

Usage

clusterAverages(ts, cls, cls.srt, avg = "median", q = 0.9, rm.inf = TRUE)

Arguments

ts

a matrix of time series, with time points in columns

cls

a clustering of the time series, length(cls) must equal nrow(cls)

cls.srt

optional sorting of the clusters

avg

a function (or the name of a function as a string) for calculating an ‘average’ value for each cluster; default is the median ## @param dev a function for calculating deviation from the the average, ## default is the standard deviation (‘sd’)

q

either numeric (0.5-1, or 0), or a string. If numeric it indicates the fraction of data shown as transparent ranges, e.g. q=0.9 indicates that 90 ranges, i.e. the 5 borders, and for q=0.5 the ranges correspond to the box limits in a boxplot. If q is a string it must be a function name for calculating variance (eg. "sd", "var"), which will be added and subtracted from the average (argument avg) for high and low data cut-offs.

rm.inf

remove infinite values (e.g. from log transformations)


raim/segmenTools documentation built on May 5, 2024, 11:30 a.m.