plot_metric.Rd
Plots a line graph of the individual metrics over time.
plot_metric(
metric,
metrics,
days = "all",
subjects = "all",
scheme = "rainbow",
col = NULL,
file = NULL,
cex.axis = 1,
las = 2,
mar = c(8, 8, 4, 0),
plot = TRUE
)
The name of the metric that is to be plotted.
A colonytrack_metrics
object, as returned by
calculate_metrics
.
Specify the days to be included is the metrics calculation. This may be in any of the standard formats (names, indices, or a logical vector). Default is to include all days present in the input data file.
Specify the subjects to be included is the metrics calculation. This may be in any of the standard formats (names, indices, or a logical vector). Default is to include all subjects present in the input data file. If a vector of subjects is supplied, the resulting plot will respect the ordering of this vector.
A code specifying the colour scheme to be used. See Details for information on the available schemes. Default is 'rainbow'.
A named vector of colours. This vector must contain the SubjectIDs
as names. Any subjects not present in this vector will be drawn in black. If
not NULL
, then this parameter overrides scheme
. Default is
NULL
.
An optional filename for PDF output. If supplied, the plot will be written to a PDF document with this name. The file is saved relative to the working directory. The default is to plot to the active graphics device.
The scaling factor for the axis labels (see
par
). Default (0.75) can be overridden for different sized
plot devices.
The label aspect (see par
. Can be overridden based on
the user's preferences.
The margins surrounding the plot (see par
). Can be
overridden for different length ID labels or to match different sized plot
devices.
If FALSE
, then the plot is not drawn and only the plotting
data are returned.
The data used in plotting (the plotted values for each subject and the colours) are returned invisibly to enable further plot customisation.