plot.dca: Plot DCA Object with ggplot

Description Usage Arguments Value Author(s) See Also Examples

View source: R/plot.R

Description

Plot DCA Object with ggplot

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S3 method for class 'dca'
plot(
  x,
  type = NULL,
  smooth = FALSE,
  span = 0.2,
  style = c("color", "bw"),
  show_ggplot_code = FALSE,
  ...
)

Arguments

x

dca object created with dca()

type

indicates type of plot to produce. Must be one of c("net_benefit", "net_intervention_avoided", "standardized_net_benefit"). The default is "net_benefit", unless the net intervention has been calculated when "net_intervention_avoided" is used, or if "standardized_net_benefit" has been calculated.

smooth

Logical indicator whether plot will be smooth with ggplot2::stat_smooth(). Default is FALSE

span

when smooth = TRUE, Controls the amount of smoothing for loess smoother. Smaller numbers produce wigglier lines, larger numbers produce smoother lines. Default is 0.2.

style

Must be one of c("color", "bw"). Default is "color", and "bw" will print a black and white figure

show_ggplot_code

Logical indicating whether to print ggplot2 code used to create figure. Default is FALSE. Set to TRUE to perform advanced figure customization

...

not used

Value

a ggplot2 object

Author(s)

Daniel D Sjoberg

See Also

dca(), net_intervention_avoided(), standardized_net_benefit(), as_tibble.dca()

Examples

1
2
dca(cancer ~ cancerpredmarker, data = df_binary) %>%
  plot(smooth = TRUE, show_ggplot_code = TRUE)

dcurves documentation built on July 20, 2021, 9:08 a.m.