| plot.r4vn_tabscore | R Documentation |
Draw one or all publication-oriented scorecard graphics using base R only.
With which="all" (the default), every available graph is drawn in sequence;
in RStudio the back/forward arrows in the Plots pane can be used to review the
complete plot history. The same available graphics are embedded automatically
in the HTML Viewer when the original tabscore() call used plot=TRUE.
## S3 method for class 'r4vn_tabscore'
plot(
x,
which = c("all", "risk", "roc", "calibration", "decision", "distribution"),
title = NULL,
font_family = "sans",
...
)
x |
A |
which |
Plot type: |
title |
Optional custom title when one plot is requested. With
|
font_family |
Base-R graphics font family. Default |
... |
Additional arguments are reserved. |
For one plot, invisibly returns its plotted data. With which="all",
invisibly returns a named list containing the data for every graph drawn.
set.seed(23)
d <- data.frame(
age = rnorm(160, 50, 11),
smoke = factor(rbinom(160, 1, .30), 0:1, c("No", "Yes"))
)
d$event <- rbinom(160, 1, plogis(-3.5 + .045*d$age + .7*(d$smoke == "Yes")))
z <- tabscore(event, c(age, smoke), data=d,
validate="none", plot=TRUE, show=FALSE)
plot(z, which="risk")
plot(z, which="roc")
plot(z) # all available plots, one after another
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.