zscore: Wrapper for z-normalization

View source: R/UTILS-zscore.R

zscoreR Documentation

Wrapper for z-normalization

Description

Wrapper for function base::scale() that returns zeros instead of NaN. It also supports matrices, data frames, and lists of time series.

Usage

zscore(
  x,
  ...,
  multivariate = FALSE,
  keep.attributes = FALSE,
  error.check = TRUE
)

Arguments

x

Data to normalize. Either a vector, a matrix/data.frame where each row is to be normalized, or a list of vectors/matrices.

...

Further arguments to pass to base::scale().

multivariate

Is x a multivariate time series? It will be detected automatically if a list is provided in x.

keep.attributes

Should the mean and standard deviation returned by base::scale() be preserved?

error.check

Logical indicating whether the function should try to detect inconsistencies and give more informative errors messages. Also used internally to avoid repeating checks.

Details

Multivariate series must have time spanning the rows and variables spanning the columns.

Value

Normalized data in the same format as provided.


dtwclust documentation built on Sept. 11, 2024, 9:07 p.m.