sankey: Quickly get a D3 js sankey

Description Usage Arguments Vignette Bugs Examples

View source: R/sankey.R

Description

This function will take 4 columns of data, format the data, then feed it to networkD3 where it will be converted into a D3 plot.

Usage

1
2
sankey(dataframe, id = NULL, linename = NULL, linenumber = NULL,
  n_common = 3, return_data = F, postfix = " patients")

Arguments

dataframe

the dataframe holding the data

id

grouping variable that links the long data. Most likely patient id.

linename

The name of the line - or whatever goes in the bars

linenumber

A column with the numeric line number.

n_common

The n most common treatments you want to include. Others will go into no treatment or other.

return_data

FALSE by default. If true, it will return the formatted data for you to pass to the plotting function yourself.

postfix

What do you want to go on the labels for the Sankey

Vignette

This function has a vignette - https://pages.github.roche.com/Rpackages/RochePlot/articles/pkgdown_only/sankey.html

Bugs

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

Examples

1
paste("See https://pages.github.roche.com/Rpackages/RochePlot/articles/pkgdown_only/sankey.html")

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