hedCreateTrans: Create data for 'hed' approach

Description Usage Arguments Value Examples

View source: R/hedCreateTrans.R

Description

Generate standardized data for the 'hed' modeling approach

Usage

1
2
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 # 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')

hpiR documentation built on April 1, 2020, 5:09 p.m.