spread: Construct scatterplot / boxplots for the data

View source: R/spread.R

spreadR 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 TRUE, then the histograms and barplots are produced on the diagonal of the matrix. Otherwise the names of the variables are written there.

log

If TRUE, then the logarithms of all numerical variables are taken.

lowess

If TRUE, then LOWESS lines are added to scatterplots and means are connected with lines on boxplots, see lowess for details.

...

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.

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

plot, table, tableplot

Examples


### Simple example
spread(mtcars)
spread(mtcars,log=TRUE)


config-i1/greybox documentation built on Dec. 12, 2024, 1:42 p.m.