View source: R/02_data_preparation.R
uni.dotplots | R Documentation |
The uni.dotplots
function draws, within a single panel, an independent Cleveland dotplot
(i.e. plotting value against rank) for each numeric (continuous or discrete) variable in a given
dataset. It is particularly useful for data exploration (e.g. Zuur et al., 2010). For instance,
to simultaneously observe the distributions of all numeric variables or to detect their
univariate outliers.
uni.dotplots(
dataset,
MAR = c(3, 2, 0.5, 1.5),
CEX.LAB = 1.2,
FONT.LAB = 2,
BTY = "n",
FG = "gray35",
COL.AXIS = "gray35",
COL.LAB = "gray20",
CEX.PAR = 0.6,
TCL = -0.3,
MGP = c(1.7, 0.6, 0.1),
OMA = c(1, 0, 1, 0),
LAB = c(5, 10, 7),
COL.PCH = "lightcoral",
PCH = 19,
COL.GRID = "lavender",
NX = 5,
NY = 9,
LTY = 6,
...
)
dataset |
The input dataset containing all variables to be plotted (must be a |
MAR |
A numerical vector of the form |
CEX.LAB |
The magnification to be used for x and y labels relative to the current setting
of |
FONT.LAB |
The font to be used for x and y labels. |
BTY |
A character string which determined the type of box which is drawn about plots. If |
FG |
The color to be used for the foreground of plots. This is the default color used for things like axes and boxes around plots (defaults to "gray35"). |
COL.AXIS |
The color to be used for axis annotation. Defaults to "gray35". |
COL.LAB |
The color to be used for x and y labels. Defaults to "gray20". |
CEX.PAR |
A numerical value giving the amount by which plotting text and symbols should be
magnified relative to the default (for |
TCL |
The length of tick marks as a fraction of the height of a line of text. The default value is -0.3. |
MGP |
The margin line (in |
OMA |
A vector of the form |
LAB |
A numerical vector of the form |
COL.PCH |
The color to be used for points. Default is "lightcoral". |
PCH |
The type of points to be drawn. Default is 19. See |
COL.GRID |
The color of the background grid. Default is "lavender". |
NX |
The number of lines for the grid in x. Default value is 5. |
NY |
The number of lines for the grid in Y. Default value is 9. |
LTY |
The type of lines to be drawn in the background grid. Default value is 6. |
... |
Any other parameter that can be incorporated in |
The uni.dotplots
function only modifies the graphical parameters of the
plot
function in the graphics
package to match some predefined
preferences. Therefore, default values of uni.dotplots
create nice looking dotplots but retain
some aspects of the original plot
function. These aspects can however be changed as in
plot
.
On the other hand, panel parameters are internally controlled using par
. However, to avoid unforeseen
conflicts with other internal parameters, it is not possible to tune panel parameters as we would
do with par
. Instead, parametrization is only possible with the given subset of parameters.
A panel of univariate dotplots.
To avoid recursive argument errors, internal arguments should be called using upper case
letters (e.g. CEX.LAB = 0.9) whereas other arguments from the plot
function should be called with
their normal case writing (e.g. sub = "My subtitle")!
data("mtcars")
uni.dotplots(dataset = mtcars, COL.GRID = "lightblue", LTY = 1, NX = 10, NY = 20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.