Learn R Programming

PatientLevelPrediction (version 6.5.1)

plotNetBenefit: Plot the net benefit

Description

Plot the net benefit

Usage

plotNetBenefit(
  plpResults,
  modelNames = NULL,
  typeColumn = "evaluation",
  saveLocation = NULL,
  showPlot = TRUE,
  fileName = "netBenefit.png",
  evalType = NULL,
  ylim = NULL,
  xlim = NULL
)

Value

A list of ggplot objects or a single ggplot object if only one evaluation type is plotted

Arguments

plpResults

list of (named) plpResult objects or a single plpResult as generated using the runPlp function.

modelNames

(optional) names of the models to be used in the plot. If NULL, the names of the plpResults are used. Must have the same length as plpResults.

typeColumn

The name of the column specifying the evaluation type

saveLocation

Directory to save plot (if NULL plot is not saved)

showPlot

If TRUE, the plot is shown on the screen, if FALSE the plot object is returned without plotting.

fileName

Name of the file to save to plot, for example 'plot.png'. See the function ggsave in the ggplot2 package for supported file formats.

evalType

Which evaluation type to plot for. For example Test, Train. If NULL everything is plotted

ylim

The y limits for the plot, if NULL the limits are calculated from the data

xlim

The x limits for the plot, if NULL the limits are calculated from the data

Examples

Run this code
  # takes too long 
data("simulationProfile")
plpData <- simulatePlpData(simulationProfile, n = 1000, seed = 42)
saveLoc <- file.path(tempdir(), "plotNetBenefit")
results <- runPlp(plpData, outcomeId = 3, saveDirectory = saveLoc)
plotNetBenefit(results)
# clean up
unlink(saveLoc, recursive = TRUE)

Run the code above in your browser using DataLab