as.clv.data | R Documentation |
Functions to coerce transaction data to a clv.data
object.
as.clv.data(
x,
date.format = "ymd",
time.unit = "weeks",
estimation.split = NULL,
name.id = "Id",
name.date = "Date",
name.price = "Price",
...
)
## S3 method for class 'data.frame'
as.clv.data(
x,
date.format = "ymd",
time.unit = "weeks",
estimation.split = NULL,
name.id = "Id",
name.date = "Date",
name.price = "Price",
...
)
## S3 method for class 'data.table'
as.clv.data(
x,
date.format = "ymd",
time.unit = "weeks",
estimation.split = NULL,
name.id = "Id",
name.date = "Date",
name.price = "Price",
...
)
x |
Transaction data. |
date.format |
Character string that indicates the format of the date variable in the data used. See details. |
time.unit |
What time unit defines a period. May be abbreviated, capitalization is ignored. See details. |
estimation.split |
Indicates the length of the estimation period. See details. |
name.id |
Column name of the customer id in |
name.date |
Column name of the transaction date in |
name.price |
Column name of price in |
... |
Ignored |
See section "Details" of clvdata for more details on parameters and usage.
# dont test because ncpu=2 limit on cran (too fast)
data(cdnow)
# Turn data.table of transaction data into a clv.data object,
# using default date format and column names but no holdout period
clv.cdnow <- as.clv.data(cdnow)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.