Description Usage Arguments Details Examples
Normalize each column of the object using different methods. See details.
1 2 3 4 5 6 7 |
x |
a vector, matrix, data frame or |
... |
additional arguments to be passed to or from methods. |
method |
a character string indicating which method to use. Must be 'sd1'(default), 'anomaly' or 'perc'. See details. |
base.period |
a vector indicating the index or range of the base period. If NULL, base period is the all index range. For matrix, base.period means the row numbers. |
Three methods for normalization can be used:
"anomaly": Each column is normalized by x - μ,
where μ is the mean value based on the base.period
.
"perc": Each column is normalized by 100 (x - μ) / μ. This is often called anomaly percentage.
"sd1": Each column is normalized by (x - μ) / σ,
where σ is the standard deviation based on the base.period
.
The standard deviations of the results will be 1 if the base.period
is set to be the whole time range.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | x <- matrix(1 : 20, nrow = 10)
colnames(x) <- c('a', 'b')
rownames(x) <- 1 : 10
normalize(x, method = 'anomaly')
normalize(x, method = 'perc')
normalize(x, method = 'sd1')
z <- zoo(x, order.by = 1991 : 2010)
normalize(z)
x <- matrix(1 : 20, nrow = 5)
colAttr <- data.frame(month = c(2, 3, 5, 6), name = c(rep('xxx', 3), 'yyy'))
zc <- zoocat(x, order.by = 1991 : 1995, colattr = colAttr)
normalize(zc)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.