Skip to contents

[Superseded]

This function will plot the percent target attainment for objects made with the makePTA function. It is largely now a legacy plotting function, superseded by plot.PM_pta.

Usage

# S3 method for PMpta
plot(
  x,
  include,
  exclude,
  plot.type = "pta",
  log = TRUE,
  pch,
  grid,
  xlab,
  ylab,
  col,
  lty,
  lwd = 4,
  legend = TRUE,
  ci = 0.9,
  out = NA,
  ...
)

Arguments

x

The name of an PMpta data object read by makePTA

include

A vector of simulations (regimens) to include in the plot, e.g. c(1,3)

exclude

A vector of simulations (regimens) in the plot, e.g. c(2,4:6)

plot.type

Character vector controlling type of plot. Default is “pta”, which plots proportion with success on the y-axis and target on the x-axis. The other choice is “pdi”, which plots the median pdi (pharmacodynamic index), e.g. AUC/MIC, on the y-axis, and target on the x-axis.

log

Boolean operator to plot x-axis in logarithmic scale; the default is True

pch

Vector of integers which control the plotting symbol for each regimen curve; the default is 1:nsim. NA results in no symbol. Use 0 for open square, 1 for open circle, 2 for open triangle, 3 for cross, 4 for X, or 5 for a diamond. Other alternatives are “*” for asterisks, “.” for tiny dots, or “+” for a smaller, bolder cross. These plotting symbols are standard for R (see par).

grid

Either a boolean operator to plot a reference grid, or a list with elements x and y, each of which is a vector specifying the native coordinates to plot grid lines; the default is False. For example, grid=list(x=seq(0,24,2),y=1:10). Defaults for missing x or y will be calculated by axTicks.

xlab

Label for the x axis. Default is “MIC”

ylab

Label for the y axis. Default is “Proportion with success”

col

A vector of color names to be used for each regimen plotted. If the length of col is too short, values will be recycled.

lty

A vector of line types to be used for each regimen plotted. If the length of lty is too short, values will be recycled.

lwd

Line width, with default of 4.

legend

Either a boolean operator or a list of parameters to be supplied to the legend function (see its documentation). If False, a legend will not be plotted. If True (the default), the default legend parameters will be used, as documented in that function, with exceptions as noted in Details.

ci

Confidence interval around curves on pdi plot, on scale of 0 to 1. Default is 0.9.

out

Direct output to a PDF, EPS or image file. Format is a named list whose first argument, type is one of the following character vectors: “pdf”, “eps” (maps to postscript), “png”, “tiff”, “jpeg”, or “bmp”. Other named items in the list are the arguments to each graphic device. PDF and EPS are vector images acceptable to most journals in a very small file size, with scalable (i.e. infinite) resolution. The others are raster images which may be very large files at publication quality dots per inch (DPI), e.g. 800 or 1200. Default value is NA which means the output will go to the current graphic device (usually the monitor). For example, to output an eps file, out=list(“eps”) will generate a 7x7 inch (default) graphic.

...

Other parameters as found in plot.default.

Value

Plots the object.

Details

For the legend, defaults that are different that the standard are:

  • x Default “topright”

  • legend Default will be the labeled regimen names supplied during makePTA, or if missing, “Regimen 1, Regimen 2,...Regimen n”, where n is the number of regimens in the PMpta object. This default can be overridden by a supplied character vector of regimen names.

  • col The color of each Regimen plot as specified by the default color scheme or col

  • pch The plotting character for each Regimen plot as specified by the default plotting characters or pch

  • lty The line type of each Regimen plot as specified by the default line types or lty

  • bg Default “white”

See also

Author

Michael Neely

Examples

if (FALSE) {
pta1 <- simEx$pta(
  simlabels <- c("600 mg daily", "1200 mg daily", "300 mg bid", "600 mg bid"),
  targets = c(0.25, 0.5, 1, 2, 4, 8, 16, 32), target.type = "time",
  success = 0.6, start = 120, end = 144
)
pta1$summary()
pta1$plot()
}