piar: Price Index Aggregation in R
Description
Significant changes
elemental_index()
,price_relative()
,shadow_price()
,carry_forward()
, andcarry_backward()
now have a formula interface to select the relevant, e.g., price variables from a data frame instead of usingwith()
. This changes the signature of these functions, and may break old code if argument were not named.as_aggregation_structure(list)
andmean(index)
now require theweights
argument to be named to be consistent with other functions.
The
aggregate_piar_index
class has been removed. This class was not well thought out, and added unnecessary restrictions and complications to certain functions. In most cases this has little impact on existing code, but does mean that the few functions related to aggregate indexes have been removed.The deprecated
cols
argument foras_index(data.frame)
has been removed.The default window size for
mean(index)
now covers the entire index. This makes it so thatmean()
doesn't assume an index is monthly, and makes it easier to usemean()
with the newwindow()
method for index object.
Improvements
as_index()
gains a new argumentcontrib
to add contributions to pre-computed indexes.Added
contrib2DF()
to extract percent-change contributions as a data frame.elemental_index()
,price_relative()
,shadow_price()
,carry_forward()
, andcarry_backward()
now require the arguments for time periods, products, and elemental aggregates to be named so as to avoid accidentally changing the order of these arguments (gh #7).Added
interact_classifications()
to get the interaction of different dimensions for a hierarchical classification.unchain()
gets an new argumentbase
for better interaction withchain()
andrebase()
.aggregate(index)
gets a new argumentinclude_ea
to control whether elemental indexes are returned when aggregating.The
summary()
method for indexes has been changed to simply print a summary of the index, rather than try to summarized the index values.aggregate(index)
now imputes percent-change contributions for missing index values whenna.rm = TRUE
. The previously undocumented behavior was to simply drop them.Added
window(index)
to extract a window of price indexes andwindow(index) <- value
to replace them.The base period for
rebase()
can now be a time period specifying a new base period. This makes it easier to rebase with pipes; e.g.,index |> mean() |> rebase("202001")
.elemental_index()
gets a new argumentproduct
to better control product names.
Files
marberts/piar-v0.8.1.zip
Files
(156.8 kB)
Name | Size | Download all |
---|---|---|
md5:ee2662396ebe950ff9bfafeb28215374
|
156.8 kB | Preview Download |
Additional details
Related works
- Is supplement to
- Software: https://github.com/marberts/piar/tree/v0.8.1 (URL)