This is the source code for an interactive online demo of the R packages BTYD
and BTYDplus
. See https://github.com/wu-service-marketing/BTYDshiny/issues/1 for the planned UI.
<-
and not =
as assignment operator"
rather than single quotes '
=
, +
, -
, '>', <-
, etc.), except for :
and ::
if (foo) bar(x = 3)
else
, closing parenthesis or a commaTools > Global Options > Code > Saving
.# Good Style
if (foo) do()
if (foo && bar > 0) {
y <- bar + 2
message("y is ", y)
}
if (y == 0) {
log(x)
} else {
y + x
}
saySomething <- function(a = "a long argument",
b = "another argument",
c = "another long argument") {
}
I think that ca 95% of work is done. There are a couple of problems, that we need to solve:
plot freq and recency vs holdout transactions
functions for MBG/NBD
and MBG/CNBD-k
modelsestimated parameters - meann(lifetime) - meann(itt) - meann(palive)
Warning:in formatC(x = c(9862, 9865, 9862, 9862, 9893, 9862, 9904, 9904, : class of 'x' was discarded
MBG/NBD
model: even parameter max.param.value = 100
doesn't help a lot.Note: "Donation" and "Grocery" datasets don't have information about "sales": that is why i didn't include the information about sales.avg estimated in CBS tables
But, I think, other items of plan are done. I need a fresh look on this app, so if I missed something let me know. I am waiting for the further instructions.