Normalise.purse {COINr} | R Documentation |
Create normalised data sets in a purse of coins
Description
This creates normalised data sets for each coin in the purse. In most respects, this works in a similar way
to normalising on a coin, for which reason please see Normalise.coin()
for most documentation. There is however
a special case in terms of operating on a purse of coins. This is because, when
dealing with time series data, it is often desirable to normalise over the whole panel data set at once
rather than independently for each time point. This makes the resulting index and aggregates comparable
over time. Here, the global
argument controls whether to normalise each coin independently or to normalise
across all data at once. In other respects, this function behaves the same as Normalise.coin()
.
Usage
## S3 method for class 'purse'
Normalise(
x,
dset,
global_specs = NULL,
indiv_specs = NULL,
directions = NULL,
global = TRUE,
write_to = NULL,
...
)
Arguments
x |
A purse object |
dset |
The data set to normalise in each coin |
global_specs |
Default specifications |
indiv_specs |
Individual specifications |
directions |
An optional data frame containing the following columns:
|
global |
Logical: if |
write_to |
Optional character string for naming the data set in each coin. Data will be written to
|
... |
arguments passed to or from other methods. |
Details
The same specifications are passed to each coin in the purse. This means that each coin is normalised using the same set of specifications and directions. If you need control over individual coins, you will have to normalise coins individually.
Value
An updated purse with new normalised data sets added at .$Data$Normalised
in each coin
Examples
# build example purse
purse <- build_example_purse(up_to = "new_coin", quietly = TRUE)
# normalise raw data set
purse <- Normalise(purse, dset = "Raw", global = TRUE)