Plot DCA Object with ggplot
# S3 method for dca plot( x, type = NULL, smooth = FALSE, span = 0.2, style = c("color", "bw"), show_ggplot_code = FALSE, ... )
x | dca object created with |
---|---|
type | indicates type of plot to produce. Must be one of
|
smooth | Logical indicator whether plot will be smooth with
|
span | when |
style | Must be one of |
show_ggplot_code | Logical indicating whether to print ggplot2 code used to
create figure. Default is |
... | not used |
a ggplot2 object
Daniel D Sjoberg
#> # ggplot2 code to create DCA figure ------------------------------- #> as_tibble(x) %>% #> dplyr::filter(!is.na(net_benefit)) %>% #> ggplot(aes(x = threshold, y = net_benefit, color = label)) + #> stat_smooth(method = "loess", se = FALSE, formula = "y ~ x", #> span = 0.2) + #> coord_cartesian(ylim = c(-0.014, 0.14)) + #> scale_x_continuous(labels = scales::percent_format(accuracy = 1)) + #> labs(x = "Threshold Probability", y = "Net Benefit", color = "") + #> theme_bw()