compare_indices_df {PriceIndices} | R Documentation |
A function for graphical comparison of price indices
Description
This function returns a figure with plots of selected price indices.
Usage
compare_indices_df(
data,
names = colnames(data)[2:length(colnames(data))],
date_breaks = "1 month"
)
Arguments
data |
The user's data frame with price index values. It must contain columns: |
names |
A vector of strings indicating names of indices which are to be used in the figure's legend. |
date_breaks |
A string giving the distance between breaks on the X axis like "1 month" (default value) or "4 months". |
Value
This function returns a figure with plots of previously calculated indices (together with dates on X-axis and a corresponding legend). Indices must be provided as a data frame, where the the first column must includes dates limited to the year and month (e.g.: "2020-04").
Examples
df<-price_indices(milk, start = "2018-12", end = "2019-12",
formula=c("laspeyres", "fisher"), interval = TRUE)
compare_indices_df(df)
[Package PriceIndices version 0.1.9 Index]