g_waterfall | R Documentation |
This basic waterfall plot visualizes a quantity height
ordered by value with some markup.
g_waterfall(
height,
id,
col_var = NULL,
col = getOption("ggplot2.discrete.colour"),
xlab = NULL,
ylab = NULL,
col_legend_title = NULL,
title = NULL
)
height |
( |
id |
( |
col_var |
( |
col |
( |
xlab |
( |
ylab |
( |
col_legend_title |
( |
title |
( |
A ggplot
waterfall plot.
library(dplyr)
library(nestcolor)
g_waterfall(height = c(3, 5, -1), id = letters[1:3])
g_waterfall(
height = c(3, 5, -1),
id = letters[1:3],
col_var = letters[1:3]
)
adsl_f <- tern_ex_adsl %>%
select(USUBJID, STUDYID, ARM, ARMCD, SEX)
adrs_f <- tern_ex_adrs %>%
filter(PARAMCD == "OVRINV") %>%
mutate(pchg = rnorm(n(), 10, 50))
adrs_f <- head(adrs_f, 30)
adrs_f <- adrs_f[!duplicated(adrs_f$USUBJID), ]
head(adrs_f)
g_waterfall(
height = adrs_f$pchg,
id = adrs_f$USUBJID,
col_var = adrs_f$AVALC
)
g_waterfall(
height = adrs_f$pchg,
id = paste("asdfdsfdsfsd", adrs_f$USUBJID),
col_var = adrs_f$SEX
)
g_waterfall(
height = adrs_f$pchg,
id = paste("asdfdsfdsfsd", adrs_f$USUBJID),
xlab = "ID",
ylab = "Percentage Change",
title = "Waterfall plot"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.