Description Usage Arguments Value See Also Examples
Calculate churn using variable window size
1 |
df |
A data frame |
groupVars |
A character vector of variable names to group by |
deathThreshold |
A numeric value indicating how many years must elapse before an individual is considered churned |
A dataframe with columns for grouping variables and columns churnedCustomers, retainedCustomers, totalCustomers, churnRate, and retentionRate
Other analysis functions: calcGenderProportion
,
calcParticipation
,
calcRecruitment
,
countCustomers
, countItems
,
itemGroupCount
, sumRevenue
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | # Demo data: Churn for customers purchasing a fishing
# license between 2010 and 2017
filterData(
dataSource = "csv",
activeFilters = list(itemType = "Fish", itemYear = c(2010, 2017))
) %>%
calcChurn(c("itemType"))
## Not run:
# Database connection. Suggest using keyring package to avoid hardcoding
# passwords
myConn <- DBI::dbConnect(odbc::odbc(),
dsn = "HuntFishApp", # Your datasource name
uid = keyring::key_get("HuntFishAppUID"), # Your username
pwd = keyring::key_get("HuntFishAppPWD")
) # Your password
# SQL Backend: Churn for customers purchasing a fishing
# license between 2010 and 2017
filterData(
dataSource = "sql",
conn = myConn,
activeFilters = list(itemType = "Fish", itemYear = c(2010, 2017))
) %>%
calcChurn(c("itemType"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.