attrition: Quickly get an attrition plot

Description Usage Arguments Bugs Examples

View source: R/attrition.R

Description

This function will take raw values. It's based on a stackoverflow post (see raw code).

Usage

1
attrition(inputs, losses, unit, labels, format = "plot")

Arguments

inputs

Numeric vector of n's going in

losses

Numeric vector of n's going out - last is those included

unit

Preface a unit?

labels

Character vector of labels - in order of inputs then losses.

format

The default is "plot," which produces a plot in the R graphics device. Current alternate options include "pdf" and "bmp," which produce those file types under the name "Sankey.xxx" in the current directory.

Bugs

If you find an issue, post it here and we'll try and fix it: http://go.roche.com/RochePlotissue

Examples

1
2
3
4
5
6
attrition(
  inputs = c(212,304),
  losses = c(111,134,271),
  unit = "",
  labels = c("Medicare","Commercial","No followup","Missing something","Included")
)

epijim/PharmaPlots documentation built on Nov. 4, 2019, 11:54 a.m.