Learn R Programming

PriceIndices (version 0.0.7)

quantities: Providing quantities of sold products

Description

The function returns quantities of sold products with given IDs.

Usage

quantities(data, period, set = c())

Value

The function analyzes the user's data frame and returns quantities of products with given ID and being sold in the time period indicated by the period parameter.

Arguments

data

The user's data frame. It must contain columns: time (as Date in format: year-month-day, e.g. '2020-12-01'), quantities (as positive numeric) and prodID (as numeric, factor or character) with unique product IDs.

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 quantities of sold products (see also data_matching). If the set is empty, the function returns quantities of all products being available in period.

Examples

Run this code
quantities(milk, period="2019-06")
quantities(milk, period="2019-12",set=c(400032, 71772, 82919))

Run the code above in your browser using DataLab