summary_churn: Summarize churn by year

Description Usage Arguments See Also Examples

View source: R/prepare.R

Description

This is a simple calculation that doesn't take into account multi-year licenses, so it should only be used for initial data validation

Usage

1
2
summary_churn(x, years, rnd = 1, out = NULL, title = "Churn by Year",
  note = NULL, suppress_notes = FALSE)

Arguments

x

data frame: Table holding sales by year with a minimum of 2 variables (cust_id, year)

years

numeric: range of years needed to calculate churn

rnd

numeric: number of decimals to round pct change results

out

character: file path to optional output csv

title

character: title for output table

note

character: note for output table

suppress_notes

logical: If TRUE, returns a data frame only

See Also

Other functions for validating license data: check_dups, count_lines_textfile, summary_initial, summary_sale

Examples

1
2
3
4
5
6
7
library(dplyr)
data(sale, lic)
summary_churn(sale, 2012:2018)

sale <- left_join(sale, lic)
filter(sale, type %in% c("hunt", "combo")) %>%
    summary_churn(2012:2018, title = "Hunting Churn", note = "A note")

southwick-associates/salic documentation built on Nov. 5, 2019, 9:13 a.m.