View source: R/hedCreateTrans.R
hedCreateTrans | R Documentation |
Generate standardized data for the 'hed' modeling approach
hedCreateTrans(
trans_df,
prop_id,
trans_id,
price,
date = NULL,
periodicity = NULL,
...
)
trans_df |
sales transaction in either a data.frame or a trans_df class from dateToPeriod() function |
prop_id |
field contain the unique property identification |
trans_id |
field containing the unique transaction identification |
price |
field containing the transaction price |
date |
default=NULL, field containing the date of the transaction. Only necessary if not passing an 'hpidata' object |
periodicity |
default=NULL, field containing the desired periodicity of analysis. Only necessary if not passing a 'hpidata' object |
... |
Additional arguments |
data.frame of transactions with standardized period field. Note that a full data.frame of the possible periods, their values and names can be found in the attributes to the returned 'hed' object
# Load example data
data(ex_sales)
# Create Hed Data
ex_heddata <- hedCreateTrans(trans_df = ex_sales,
prop_id = 'pinx',
trans_id = 'sale_id',
price = 'sale_price',
date = 'sale_date',
periodicity = 'monthly')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.