RevCntAct: Calculate revenue accounting matrix by counts

Description Usage Arguments Value Author(s) Examples

View source: R/RevCntAct.R

Description

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

Usage

1
RevCntAct(datall_revenue, type, dates)

Arguments

datall_revenue

subscription data, need to have columns: user_id, Product, Effective_Start, Effective_End, MRR

type

product type

dates

a date vector (have to be date type)

Value

A revenue accounting matrix by count is returned for each date.

Author(s)

Hui Lin, longqiman@gmail.com

Examples

1
2
3
4
5
6
7
8
9
## 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)
{NetlifyDS::mrrAtDateType(time_point, subs = base_monthly, type = NULL)})
growth_matrix_identity = RevCntAct(datall_revenue = total_revenue, type = c("Identity"), dates = dates)

## End(Not run)

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