View source: R/evaluateMatched.R
productChanges | R Documentation |
This function will give the product ID's of products that appear or disappear in each period.
productChanges(x, pervar, prodID)
x |
A dataframe containing price, quantity, a time period identifier and a product identifier. It must have column names. |
pervar |
A character string for the name of the time variable. This variable must contain integers starting at period 1 and increasing in increments of 1 period. There may be observations on multiple products for each time period. |
prodID |
A character string for the name of the product identifier |
a list containing one element for each time period, each element of which contains two vectors (one for appearing products, and one for disappearing products)
# create a dataset with some missing products
df <- CES_sigma_2[-c(3,4,15),]
# show the products that changed
productChanges(df, "time", "prodID")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.