periodTable: Create a table of the periods (generic method)

View source: R/dateToPeriod.R

periodTableR Documentation

Create a table of the periods (generic method)

Description

Generic method for create simple table of all selected periods. Used within 'dateToPeriod()'

Usage

periodTable(trans_df, periodicity, ...)

Arguments

trans_df

Transaction data.frame

periodicity

Periodicity option ('weekly', 'monthly', 'quarterly', 'annually')

...

Additional Arguments

Value

[data.frame] consisting of

period

Period number

start_date

start date of each period

end_date

end date of each period

name

name of the period

Examples


 # Load data
 data(ex_sales)
 ex_sales$trans_date <- checkDate(ex_sales[['sale_date']], 'date')

 # With a raw transaction data.frame
 pt_df <- periodTable(trans_df = ex_sales,
                      periodicity = 'annual')

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