super_distriplot: Creation of a multi-plot of variables distribution

Description Usage Arguments Value Note Examples

Description

The super_distriplot() function plots, in a single viewing window, the distribution of MYVARIABLES for all the GROUPS to which they belong. It is very useful to quickly visualize if the among groups normality assumption is respected or not. The function additionally plots the curve of the probability density function of each sampled population, and that of a Normal distribution.

Usage

1
super_distriplot(MYVARIABLES, GROUPS, breaks)

Arguments

MYVARIABLES

A numeric vector or an array (up to 5) of numeric vectors (typically, variables as columns of a dataframe or matrix).

GROUPS

A factor whose length matches the length of the variables of interest. The maximal number of groups/treatments to divide the observations is limited to 4 (see 'note').

breaks

A value, a vector of values, an algorithm etc. to set the width of the bars in the histograms (for more details on the possible input values, please refer to the help page of hist).

Value

A vinwing window with as many histograms as there are combinations between the input variables and groups (up to 20).

Note

For graphical convenience, the function cannot plot too many distributions in a single window. For that reason, only a maximum of 4 different groups and 5 different variables is allowed as inputs in the function (giving a window with 20 plots).
If ou wish to plot more variables and/or groups, please divide your data and run the function several times on each subset.
Also, if you wish to plot a single variable divided in different groups, you need to specify MYVARIABLES that your single vector (i.e. your variable) is a dataframe. Otherwise, super_distriplot() will not be able to write a proper title to the histograms. If you want a proper title, then use a synthax as follows: ... MYVARIABLES = as.data.frame(myvector) ... or, for a single column, ... MYVARIABLES = as.data.frame(mydata$myvariable) ... (see also 'examples').

Examples

1
2
3
4
5
6
library(vegan)
data("dune")
data("dune.env")
super_distriplot(MYVARIABLES = dune[,3:6], GROUPS = dune.env[,4], breaks = 5)
# For a single variable (e.g. Bellis perennis):
super_distriplot(MYVARIABLES = as.data.frame(dune$Bellpere), GROUPS = dune.env[,4], breaks = 5)

mrelnoob/airpoumpoum documentation built on Feb. 11, 2020, 8:19 p.m.