elog2cum {BTYDplus}R Documentation

Convert Event Log to Transaction Counts

Description

Aggregates an event log to either incremental or cumulative number of transactions. If first=TRUE then the initial transactions of each customer are included in the count as well.

Usage

elog2cum(elog, by = 7, first = FALSE)

elog2inc(elog, by = 7, first = FALSE)

Arguments

elog

Event log, a data.frame with columns cust and transaction time t or date.

by

Only return every by-th count Defaults to 7, and thus returns weekly numbers.

first

If TRUE, then the first transaction for each customer is being counted as well

Details

Duplicate transactions with identical cust and date (or t) field are counted only once.

Value

Numeric vector of transaction counts.

Examples

data("groceryElog")
cum <- elog2cum(groceryElog)
plot(cum, typ="l", frame = FALSE)
inc <- elog2inc(groceryElog)
plot(inc, typ="l", frame = FALSE)

[Package BTYDplus version 1.2.0 Index]