# \donttest{
data("cdnow")
clv.data.cdnow <- clvdata(data.transactions = cdnow,
date.format="ymd",
time.unit = "w",
estimation.split = 37)
# Extract all transaction data (all ids, estimation and holdout period)
df.trans <- as.data.frame(clv.data.cdnow)
# Extract transaction data of estimation period
df.trans <- as.data.frame(clv.data.cdnow, sample="estimation")
# Extract transaction data of ids "1", "2", and "999"
# (estimation and holdout period)
df.trans <- as.data.frame(clv.data.cdnow, ids = c("1", "2", "999"))
# Extract transaction data of ids "1", "2", and "999" in estimation period
df.trans <- as.data.frame(clv.data.cdnow, ids = c("1", "2", "999"),
sample="estimation")
# }
Run the code above in your browser using DataLab