funnel_step: Continue to funnel

Description Usage Arguments Examples

Description

Continue to funnel

Usage

1
2
3
funnel_step(tbl, moment_type, type, name = moment_type, optional = FALSE, ...)

funnel_steps(tbl, moment_types, type, ...)

Arguments

tbl

A table of different moments and timestamps

moment_type

The next moment in the funnel

type

The type of after_join (e.g. "first-first", "any-any")

name

If you want a custom name instead of the moment_type; needed if the moment type is already in the sequence

optional

Whether this step in the funnel should be optional. If so, the following step will also try joining in a way that skips this step. Note that multiple optional steps in a row aren't supported.

...

Extra arguments passed on to after_left_join. For funnel_steps, these are passed on to funnel_step.

moment_types

For funnel_steps, a character vector of moment types, which are applied in order

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
library(dplyr)

activity <- tibble::tribble(
  ~ "user_id", ~ "event", ~ "timestamp",
  1, "landing", "2019-07-01",
  1, "registration", "2019-07-02",
  1, "purchase", "2019-07-07",
  1, "purchase", "2019-07-10",
  2, "landing", "2019-08-01",
  2, "registration", "2019-08-15",
  3, "landing", "2019-05-01",
  3, "registration", "2019-06-01",
  3, "purchase", "2019-06-04",
  4, "landing", "2019-06-13")

activity %>%
  funnel_start(moment_type = "landing",
               moment = "event",
               tstamp = "timestamp",
               user = "user_id")  %>%
funnel_step(moment_type = "registration",
           type = "first-firstafter")

datacamp/funneljoin documentation built on June 18, 2020, 6:52 a.m.