RevAct: Calculate revenue accounting matrix

Description Usage Arguments Value Author(s) Examples

View source: R/RevAct.R

Description

It calculates the accounting matrix given date and daily revenue data. It only returns one row for each date, i.e. it will sum up all the products.

Usage

1
RevAct(datall_revenue, type, dates)

Arguments

datall_revenue

daily revenue data, need to have columns: user_id, Product, active_date, MRR

type

product type

dates

a date vector (have to be date type)

Value

A revenue accounting matrix is returned for each date.

Author(s)

Hui Lin, longqiman@gmail.com

Examples

1
2
3
4
5
6
7
8
## Not run: 
dates <- seq(as.Date("2018-02-01"), lubridate::ceiling_date(Sys.Date(), unit = "month"), "months") - days(1)
dates
# need to get daily revenue from subscription data if you don't have that already
base_monthly = do.call("rbind", lapply(dates, function(time_point)
growth_matrix_identity = RevAct(datall_revenue = base_monthly, type = c("Identity"), dates = dates)

## End(Not run)

netlify/NetlifyDS documentation built on Aug. 8, 2020, 4:17 a.m.