Learn R Programming

PriceIndices (version 0.0.6)

compare_final_indices: A general function for graphical comparison of price indices

Description

This function returns a figure with plots of previously calculated price indices.

Usage

compare_final_indices(finalindices = list(), names = c())

Arguments

finalindices

A list of data frames with previously calculated price indices. Each data frame must consist of two columns, i.e. the first column must includes dates limited to the year and month (e.g.: "2020-04") and the second column must indicate price index values for corresponding dates. The above-mentioned single data frame may be created manually in the previous step or it may be a result of functions: price_index or final_index. All considered data frames must have an identical number of rows.

names

A vector of character strings describing names of presented indices.

Value

This function returns a figure with plots of previously calculated price indices. It allows for graphical comparison of price index values which were previously calculated and now are provided as data frames (see finalindices parameter).

Examples

Run this code
# NOT RUN {
## Caluclating two indices by using two different package functions:
# }
# NOT RUN {
index1<-final_index(datasets=list(milk), start="2018-12", 
end="2019-12",formula="walsh",interval=TRUE)
# }
# NOT RUN {
index2<-price_index(milk,start="2018-12", end="2019-12",
formula="geks",interval=TRUE)
# }
# NOT RUN {
## Graphical comparison of these two indices 
# }
# NOT RUN {
compare_final_indices(finalindices=list(index1,index2), 
names=c("Walsh index", "GEKS index"))
# }

Run the code above in your browser using DataLab