# NOT RUN {
# Create event log from file "cdnowElog.csv", which has
# customer IDs in the second column, dates in the third column, and
# sales numbers in the fifth column.
elog <- dc.ReadLines(system.file("data/cdnowElog.csv", package="BTYD"),2,3,5)
# converting the date column to Date objects is
# necessary for this function.
elog$date <- as.Date(elog$date, "%Y%m%d")
# starting date. Note that it must be a Date object.
start.date <- as.Date("1997-01-01")
# ending date. Note that it must be a Date object.
end.date <- as.Date("1997-01-31")
# Filter the elog to include only customers who made their
# first transaction in January 1997
filtered.elog <- dc.FilterCustByBirth(elog, c(start.date, end.date))
# }
Run the code above in your browser using DataLab