data_aggregating | R Documentation |
The function aggregates the user's data frame over time and optionally over outlets.
data_aggregating(data, join_outlets = TRUE)
data |
The user's data frame. |
join_outlets |
A logical value indicating whether the data aggregation over outlets should be also done. |
The function aggregates the user's data frame over time and/or over outlets. Consequently, we obtain monthly data, where the unit value is calculated instead of a price for each prodID
observed in each month (the time
column gets the Date format: "Year-Month-01"). If the parameter join_outlets
is TRUE, then the function also performs aggregation over outlets (retIDs) and the retID
column is removed from the data frame. The main advantage of using this function is the ability to reduce the size of the data frame and the time needed to calculate the price index. Please note, that unnecessary columns are removed (e.g. description
).
#Example 1
data_aggregating(dataAGGR,join_outlets = FALSE)
data_aggregating(dataAGGR,join_outlets = TRUE)
#Example 2 (data frame reduction)
nrow(milk)
nrow(data_aggregating(milk))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.