mdaplot
is used to make different kinds of plot for one set of data objects.
mdaplot(data = NULL, plot.data = NULL, type = "p", pch = 16,
col = NULL, lty = 1, lwd = 1, bwd = 0.8, cgroup = NULL,
xlim = NULL, ylim = NULL, colmap = "default", labels = NULL,
main = NULL, xlab = NULL, ylab = NULL, show.labels = F,
show.colorbar = T, show.lines = F, show.grid = T, show.axes = T,
xticks = NULL, yticks = NULL, xticklabels = NULL, yticklabels = NULL,
xlas = 0, ylas = 0, lab.col = "darkgray", lab.cex = 0.65,
show.excluded = FALSE, col.excluded = "#E0E0E0", nbins = 256,
colramp = mdaplot.getColors, force.x.values = NA, opacity = 1, ...)
a vector, matrix or a data.frame with data values.
a list of parameters and values obtained after preprocessing of original data provided by a user (if NULL it will be created automatically)
type of the plot ('p', 'l', 'b', 'h', 'e', 'i').
a character for markers (same as plot
parameter).
a color for markers or lines (same as plot
parameter).
the line type (same as plot
parameter).
the line width (thickness) (same as plot
parameter).
a width of a bar as a percent of a maximum space available for each bar.
a vector with values to use for make color groups.
limits for the x axis (if NULL, will be calculated automatically).
limits for the y axis (if NULL, will be calculated automatically).
a colormap to use for coloring the plot items.
a vector with text labels for data points or one of the following: 'names', 'indices', 'values'.
an overall title for the plot (same as plot
parameter).
a title for the x axis (same as plot
parameter).
a title for the y axis (same as plot
parameter).
logical, show or not labels for the data objects.
logical, show or not colorbar legend if color grouping is on.
vector with two coordinates (x, y) to show horizontal and vertical line cross the point.
logical, show or not a grid for the plot.
logical, make a normal plot or show only elements (markers, lines, bars) without axes.
values for x ticks
values for y ticks
labels for x ticks.
labels for y ticks.
orientation of xticklabels
orientation of yticklabels
color for data point labels.
size for data point labels.
logical, show or hide rows marked as excluded (attribute `exclrows`)
color for the excluded objects (rows)
if scatter density plot is shown, number of segments to split the plot area into (see also ?smoothScatter)
Colramp function for density scatter plot
vector with corrected x-values for a bar plot (do not specify this manually)
opacity for plot colors (value between 0 and 1)
other plotting arguments.
Most of the parameters are similar to what are used with standard plot
function. The
differences are described below.
The function makes a plot of one set of objects. It can be a set of points (scatter plot),
bars, lines, scatter-lines, errorbars og an image. The data is organized as a data frame,
matrix or vector. For scatter and only first two columns will be used, for bar plot only
values from the first row. It is recommended to use mda.subset
method if plot
should be made only for a subset of the data, especially if you have any excluded rows or
columns or other special attributed, described in the Bookdown tutorial.
If data is a data frame and contains one or more factors, they will be converted to a dummy
variables (using function mda.df2mat
) and appears at the end (last columns) if
line or bar plot is selected.
The function allows to colorize lines and points according to values of a parameter
cgroup
. The parameter must be a vector with the same elements as number of objects (rows)
in the data. The values are divided into up to eight intervals and for each interval a
particular color from a selected color scheme is assigned. Parameter show.colorbar
allows to turn off and on a color bar legend for this option.
The used color scheme is defined by the colmap
parameter. The default scheme is based
on color brewer (colorbrewer2.org) diverging scheme with eight colors. There is also a gray
scheme (colmap = 'gray'
) and user can define its own just by specifing the needed
sequence of colors (e.g. colmap = c('red', 'yellow', 'green')
, two colors is minimum).
The scheme will then be generated automatically as a gradient among the colors.
Besides that the function allows to change tick values and corresponding tick labels for x and y axis, see Bookdown tutorial for more details.
mdaplotg
- to make plots for several sets of data objects (groups of objects).
# NOT RUN {
# See all examples in the tutorial.
# }
Run the code above in your browser using DataLab