plotMeans | R Documentation |
The function plots the means of several numerical variables by the levels of one categorical variable.
plotMeans(
x,
by,
plotCI = TRUE,
alpha = 0.05,
ylab = "averages",
xlab = "",
plotLegend = TRUE,
inset = 0.01,
xleg = "topleft",
legPar = list(),
gap = 0,
labels = NULL,
...
)
x |
Data frame with values of numeric variables. |
by |
Categorical variable that defines groups. |
plotCI |
Whether to plot confidence intervals or not, default is |
alpha |
A confidence level for calculating confidence intervals (default is |
ylab |
The title of |
xlab |
The title of |
plotLegend |
Whether to plot a legend or not, default is |
inset |
Inset distance(s) from the margins as a fraction of the plot region when legend is placed by keyword. |
xleg |
Position of a legend, default is |
legPar |
Additional parameters for a legend. They have to be provided in a list format. |
gap |
Space left between the center of the error bar and the lines marking the error bar in units of the height (width). Defaults to 1.0 |
labels |
Labels of x-axis. |
... |
Arguments passed to functions |
A list with the following elements:
means
- mean values by groups.
CI
- widths of confidence intervals by groups.
Aleš Žiberna
plotMeans(x = mtcars[, c(1, 3, 5)], by = mtcars[,8])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.