Skip to content

bekerov/SampleTransactions

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

ATTENTION!

This function has been eaten (here) by my R package trinalysis which has many useful methods for working with transaction data.


SampleTransactions

Single R function to generate random transaction data such that the simulated data has a (somewhat) realistic pattern of customer churn.

Sample use:

# Transactions from 100 customers
transactions <- sampletransactions(Ncusts=100)

# Transactions from 100 customers with a standard deviation of 100 transactions per customer
transactions <- sampletransactions(Ncusts=100, sd.transactions=100)

# Transactions from 100 customers with a standard deviation of $100 per transaction
transactions <- sampletransactions(Ncusts=100, sd.amount=100)

# Transactions between 1/1/2015 and 12/31/2015
transactions <- sampletransactions(Ncusts=100, minDate=as.Date("2015-1-1"), maxDate=as.Date("2015-12-31"))

# Transactions falling into one of three categories
transactions <- sampletransactions(Ncusts=100, products=c("A", "B", "D"))

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • R 100.0%