spread {greybox} | R Documentation |
Construct scatterplot / boxplots for the data
Description
Function constructs the plots depending on the types of variables in the provided matrix / data frame.
Usage
spread(data, histograms = FALSE, log = FALSE, lowess = FALSE, ...)
Arguments
data |
Either matrix or data frame with the data. |
histograms |
If |
log |
If |
lowess |
If |
... |
Other parameters passed to the plot function. Currently only "main" parameter is accepted. |
Details
If both variables are in metric scale, then the classical scatterplot is constructed.
If one of them is either integer (up to 10 values) or categorical (aka 'factor'),
then boxplots (with grey dots corresponding to mean values) are constructed. Finally,
for the two categorical variables the tableplot is returned (see
tableplot function for the details). All of this is packed in a matrix.
The colours in the plot can be changed by defining a different palette via the
palette()
function, in which case spread() will use the first four colours
in the pallete.
See details in the vignette "Marketing analytics with greybox":
vignette("maUsingGreybox","greybox")
Value
Function does not return anything. It just plots things.
Author(s)
Ivan Svetunkov, ivan@svetunkov.com
See Also
Examples
### Simple example
spread(mtcars)
spread(mtcars,log=TRUE)