get_customers: Get Customers

Description Usage Arguments Details Examples

Description

Build a customers dataset from a transactions dataset with required columns CustomerID, TransactionDate (or alternate names)

Usage

1
2
3
get_customers(transactions, colCustomerID = "CustomerID",
  colTransactionDate = "TransactionDate", colsFinancial = NULL,
  colsCategory = NULL)

Arguments

transactions

A data.table of transactions with a column for CustomerID and TransactionDate

colCustomerID

Name of the CustomerID column

colTransactionDate

Name of the TransactionDate column

colsFinancial

Character vector corresponding to the name of financial columns in transactions

colsCategory

Character vector corresponding to the name of categorical columns in transactions

Details

Returns a data.table object with one row per unique CustomerID

Examples

1
2
3
4
5
6
library(data.table)

set.seed(2016)
transactions <- sample_transactions(10)
get_customers(transactions)
get_customers(transactions, colsFinancial=c("Amount"), colsCategory=c("Product"))

ben519/trinalysis documentation built on May 12, 2019, 10:56 a.m.