scale1 | R Documentation |
Scale time series so that they can be better compared.
scale1(x, ...)
## Default S3 method:
scale1(x, ..., when = "first.complete", level = 1,
centre = FALSE, scale = FALSE, geometric = TRUE,
total.g = NULL)
## S3 method for class 'zoo'
scale1(x, ..., when = "first.complete", level = 1,
centre = FALSE, scale = FALSE, geometric = TRUE,
inflate = NULL, total.g = NULL)
x |
a time series |
when |
origin: for the default method, either a string or
numeric (integer). Allowed strings are
|
level |
numeric |
centre |
logical |
scale |
logical or numeric |
geometric |
logical: if |
inflate |
numeric: an annual rate at which the series is inflated (or deflated if negative) |
total.g |
numeric: to total growth rate (or total return) of a series |
... |
other arguments passed to methods |
This is a generic function, with methods for numeric
vectors and matrices, and zoo
objects.
An object of the same type as x
.
Enrico Schumann
Schumann, E. (2023) Portfolio Management with R.
https://enricoschumann.net/PMwR/;
in particular, see
https://enricoschumann.net/R/packages/PMwR/manual/PMwR.html#scaling-series
scale
scale1(cumprod(1 + c(0, rnorm(20, sd = 0.02))), level = 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.