View source: R/f_data_processing.R
expenditures | R Documentation |
The function returns expenditures of sold products with given IDs.
expenditures(data, period, set = c(), ID = FALSE)
data |
The user's data frame. It must contain columns: |
period |
The time period (as character) limited to the year and month, e.g. "2019-03". |
set |
The set of unique product IDs to be used for determining expenditures of sold products (see also |
ID |
A logical parameter indicating whether a data frame with prodIDs and quantities should be returned. |
The function analyzes the user's data frame and returns expenditures of products with given ID
and being sold in the time period indicated by the period
parameter. Please note that the function returns the expenditure values for sorted prodIDs and in the absence of a given prodID in the data set, the function returns nothing (it does not return zero). If the ID parameter is set to TRUE then the function returns a data frame with columns: by
(IDs of products) and expend
(expenditures of products).
expenditures(milk, period="2019-06")
expenditures(milk, period="2019-12", set=c(400032, 82919), ID=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.