R/print.retention.R

Defines functions print.retention

Documented in print.retention

print.retention <- function(
  x,                # <retention> object. Could be generated by e.g. mixpanelGetRetention.
  percentages=TRUE, # Output as counts or percentages? Default TRUE.
  silent=FALSE,     # Silent?
  ...               # Unused.
) {
  if(percentages)
    tab = cbind(Count=x$cohortCount, x$retainPerc)
  else
    tab = cbind(Count=x$cohortCount, x$retainCount)
  
  if(!silent) {
    cat("Retention Matrix\n")
    cat("Row names are Cohort Start Dates. Column names are Periods (0 -> 0 to 1 units)\n")
    print(tab)
  }
  
  invisible(tab)
}

Try the RMixpanel package in your browser

Any scripts or data that you put into this service are public.

RMixpanel documentation built on May 1, 2019, 10:46 p.m.