RevenueMetric: 'RevenueMetric'

View source: R/revenuemetric.R

RevenueMetricR Documentation

RevenueMetric

Description

Creates a small multiple plot by sub-groups

Usage

RevenueMetric(
  FUN = "Acquisition",
  output = c("Plot", "Table", "Detail")[1],
  by = c("day", "month", "quarter", "year")[4],
  cohort.type = "None",
  cohort.period = "year",
  id,
  value,
  from,
  to,
  start = as.Date(min(from)),
  end = as.Date(max(from)),
  subscription.length = "year",
  subset = rep(TRUE, length(id)),
  profiling = NULL,
  trim.id = 50,
  mergers = NULL,
  ...
)

Arguments

FUN

A function that calculates a metric

output

Whether to output as a Plot, Table, or Detail

by

The unit of time to report on ("day", "month", "quarter", "year").

cohort.type

How cohorts are to be used when performing the analysis by setting.

"None" All customers are cohort.typed in calculations. "New" Customers added in the preceding by. "Calendar" Calender time periods are used. For example, if cohort.period is set to "year" then calendar years are used as cohorts. "Tenure" Tenure based time periods are used. For example, if cohort.period is set to "year", then cohorts are based on the number of years since a customeer first signed up. then calendar years are used as cohorts.

cohort.period

The period of aggregation to be used, with options of "week", "month", "quarter", and "year". This parameter is only used when cohort.type is "Calendar" or "Tenure"

id

A vector of character, unique identifier for subscribers that made the transactions (e.g., email addresses, names, subscriber keys).

value

A vector of containing the revenue per transaction.

from

A vector of class POSIXct or POSIXt, recording the date and time each subscription commences.

to

A vector of class POSIXct or POSIXt, recording the date and time each subscription ends

start

The date at which the analysis outputs should commence. By default, the earliest date recorded in from.

end

The date at which the analysis ends, which is used to determine churn. By default, the most recent date recorded in from.

subscription.length

The time unit that describes the subscription length: year to view the data by year, quarter, and month. This is assumed to be the billing period when determining if subscribers have churned or not.

subset

An optional vector specifying a subset of observations to be used in the calculations

profiling

Separate analyses are conducted among each unique combination of these variables.

trim.id

The maximum length of the strings to be used showing ID names (used to avoid situations where string names are so long as to make reading of tables impossible. "quarter", and "year".

mergers

A data frame with two variables 'id' and 'id.to'. 'id' contains the ids of companies that appeara, based on their data, to have churned, but have in fact merged with the corresponding 'id.to'.

...

Additional arguments to be passed to lower level functions.

Details

The cohort.type parameter does not have the transitive properties that many assume. For example, it's not always the case that "New" is equivalent to a diagonal from "Calendar", or that "None" is the column-sums of "Calendar".

Consider as an example CustomerChurn where all analysis is being done with the unit of "year". A customer that purchases a contract less than the length of a year will appear below the (possibly offset) diagonal in "Calendar" and if they renew will be in the denominator for the following year of "New", but not if they do not renew.

Similarly, with RecurringRevenueChurn, "New" in an incomplete final period will compare to the same period in the previous year, whereas the bottom row of "Calendar" will use the entire calendar yearear as the base, and thus look much better (in a misleading way).

Value

A plotly plot#?


Displayr/flipRevenueMetrics documentation built on June 14, 2025, 6:54 p.m.