retention: Retention

Description Usage Arguments Examples

Description

Retention

Usage

1
retention(x, by = c("days", "weeks", "months"), plot = T)

Arguments

x

input data frame. Must be input first column an ID value and the second column a datetype value.

by

Set the interval.

plot

Turn on plot option about retention. Default is TRUE

Examples

1
2
3
4
5
6
7
8
9
set.seed(1004)
library(lubridate)
connect_log <- data.frame(
  id = c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 5, 5),
  login_date = sample(seq(ymd_h(2018010100), ymd_h(2018010323), by = "hour"), 20)
) %>%
  arrange(id, login_date)

retention(connect_log, by = "days")

lovetoken/useful.lovetoken documentation built on June 14, 2019, 3:21 p.m.