Learn R Programming

james.analysis (version 1.0.1)

plotConvergence: Plot convergence curves

Description

Creates a plot showing the convergence curve of each search that has been applied to the given problem, aggregated over all search runs (mean or median). This is a generic S3 method.

Usage

plotConvergence(data, problem, type = c("mean", "median"), col = "black", plot.type = "s", lty, title = "Convergence curve(s)", subtitle, xlab, ylab = "Value", time.unit = c("milliseconds", "seconds", "minutes", "hours"), min.time, max.time, legend = TRUE, legend.pos, legend.inset = c(0.02, 0.05), legend.names, ...)

Arguments

data
data object containing the analysis results
problem
name of the problem for which the plot is made. Can be omitted if the data contains results for a single problem only.
type
one of "mean" (default) or "median". Determines how the values from the different search runs are aggregated.
col
color(s) of the plotted lines and/or symbols, used cyclically when providing a vector. Defaults to "black".
plot.type
defaults to "s" (staircase). See matplot and plot for more information about the possible plot types.
lty
line type(s), used cyclically when providing a vector. Line types default to 1:n where n is the number of plotted curves.
title
plot title. Defaults to "Convergence curve(s)".
subtitle
plot subtitle. By default, a subtitle will be added that states the name of the problem for which the plot was made. If no substitle is desired, set subtitle = "".
xlab
x-axis label. Defaults to "Time" followed by the time unit within brackets (abbreviated).
ylab
y-axis label. Defaults to "Value".
time.unit
one of "milliseconds" (default), "seconds", "minutes" or "hours". Determines the time unit of the values on the x-axis.
min.time
zoom in on the part of the curve(s) after this point in time on the x-axis, according to the specified time.unit.
max.time
zoom in on the part of the curve(s) before this point in time on the x-axis, according to the specified time.unit.
legend
logical: indicates whether a legend should be added to the plot. Defaults to TRUE.
legend.pos
position of the legend, specified as a keyword keyword from the list "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center". Defaults to "bottomright" in case values are being maximized or "topright" in case of minimization.
legend.inset
inset distance(s) from the margins as a fraction of the plot region. If a single value is given, it is used for both margins; if two values are given, the first is used for x-distance, the second for y-distance. Defaults to c(0.02, 0.05).
legend.names
names to be shown in the legend. Defaults to the search names obtained from calling getSearches for the given data and problem.
...
optional other arguments passed to matplot.

Details

If the data contains results for a single problem only, the argument problem can be omitted. If desired to plot convergence curves for a selection of the applied searches, use reduceJAMES to extract the respective data.

The curves are plotted using matplot. More information about the graphical parameters are provided in the documentation of this function. By default, a legend is added to the plot. This can be omitted by setting legend = FALSE. If desired, a custom legend may then be added. It is possible to zoom in on a specific region of the plot using the parameters min.time and max.time.

Any additional parameters are passed to matplot.

See Also

matplot