Learn R Programming

BTYDplus (version 1.2.0)

elog2cum: 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

Value

Numeric vector of transaction counts.

Details

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

Examples

Run this code
# NOT RUN {
data("groceryElog")
cum <- elog2cum(groceryElog)
plot(cum, typ="l", frame = FALSE)
inc <- elog2inc(groceryElog)
plot(inc, typ="l", frame = FALSE)
# }

Run the code above in your browser using DataLab