Description Usage Arguments Details Value See Also Examples
Turn a long dataset with repeat sales information into a dataset of sales pairs.
1 |
x |
A data.frame, or something that can be coerced into one. |
id |
Column name in |
date |
Column name in |
price |
Column name in |
Consecutive sales for each id are turned into pairs of consecutive sales. This is equivalent to first-differencing the data.
Observations with missing values and duplicated observations are not removed prior to creating sales pairs. Making sales pairs is generally not well defined with missing and duplicated values, and these should be removed prior to making pairs.
Extra columns with data that does not varying over time for each id are preserved when making pairs.
A data.frame.
rs_unpair
to perform the inverse operation.
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.