The function provides a data frame or a figure presenting the matched_index function calculated for the column defined by the type parameter and for each month from the considered time interval
matched_fig(
data,
start,
end,
base = "start",
type = "prodID",
fixedbase = TRUE,
figure = TRUE,
date_breaks = "1 month"
)The function returns a data frame or a figure presenting the matched_index function calculated for the column defined by the type parameter and for each month from the considered time interval. The interval is set by start and end parameters. The returned object (data frame or figure) depends on the value of figure parameter. The returned values belong to [0,1].
The user's data frame. It must contain a column time (as Date in format: year-month-day,e.g. '2020-12-01') and also a column indicated by the type parameter.
The beginning of a time interval (as character) limited to the year and month, e.g. "2019-03".
The end of a time interval (as character) limited to the year and month, e.g. "2019-04".
The base period (as character) for product comparisons. Its possible values are: "start" and "end".
This parameter defines the column which is used in the procedure. Possible values of the type parameter are: retID, prodID, codeIN, codeOUT or description.
A logical parameter indicating whether the procedure is to work for subsequent months from the considered time interval (fixedbase=FALSE). Otherwise the period defined by base plays a role of fixed base month (fixedbase=TRUE)
A logical parameter indicating whether the function returns a figure (TRUE) or a data frame (FALSE) with matched_index values.
A string giving the distance between breaks on the X axis like "1 month" (default value) or "4 months".
matched_fig(milk, start="2018-12", end="2019-12")
matched_fig(milk, start="2018-12", end="2019-12", figure=FALSE)
Run the code above in your browser using DataLab