Description Usage Arguments Value Examples
Adds new columns to zoo object with transformed data; applies for all columns in 'data'
1 2 3 |
data |
specification of zoo object |
start |
optional start date to trim 'data'; format is 'dd/mm/yyyy' |
end |
optional end date to trim 'data'; format is 'dd/mm/yyyy' |
chg |
optional string to calculate periodical changes; options are 'YoY' (Year-on-Year), 'QoQ' (Quarter-on-Quarter), 'MoM' (Month-on-Month), 'WoW' (Week-on-Week), 'DoD' (Day-on-Day) |
chg_type |
optional string to specify calculation of changes; options are 'perc' (percentage change) or 'delta' (difference) |
pma |
optional integer to specify number of data points for calculation of period-moving-averages |
pms |
optional integer to specify number of data points for calculation of period-moving-sums |
lag |
optional integer to lag the data by a number of periods; use negative integer for lead |
rebase |
optional boolean to rebase the data to 100 at first observation |
Z |
optional integer (or character) to specify the rolling number of periods over which the data is normalized; use 'all' to compute z-scores over all available periods |
returns a zoo object with original and transformed data
1 2 3 4 5 6 7 8 9 10 11 12 | Note that these examples require corresponding zoo objects to work properly
zoo <- Transform(data = zoo, chg = "YoY", chg_type = 'perc')
zoo <- Transform(data = zoo, chg = "MoM", chg_type = "delta")
zoo <- Transform(data = zoo, start = "01/01/2010", pma = 12)
zoo <- Transform(data = zoo, pma = 3)
zoo <- Transform(data = zoo, pms = 6)
zoo <- Transform(data = zoo, lag = 3)
zoo <- Transform(data = zoo, lag = -3)
zoo <- Transform(data = zoo, rebase = TRUE)
zoo <- Transform(data = zoo, Z = 12)
zoo <- Transform(data = zoo, Z = all)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.