hedCreateTrans: Create data for 'hed' approach

View source: R/hedCreateTrans.R

hedCreateTransR Documentation

Create data for 'hed' approach

Description

Generate standardized data for the 'hed' modeling approach

Usage

hedCreateTrans(
  trans_df,
  prop_id,
  trans_id,
  price,
  date = NULL,
  periodicity = NULL,
  ...
)

Arguments

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

Value

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

Examples


 # 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')


andykrause/hpiR documentation built on Feb. 2, 2024, 8:13 p.m.