plotMeans {multiUS}R Documentation

Plot the means

Description

The function plots the means of several numerical variables by the levels of one categorical variable.

Usage

plotMeans(
  x,
  by,
  plotCI = TRUE,
  alpha = 0.05,
  ylab = "averages",
  xlab = "",
  plotLegend = TRUE,
  inset = 0.01,
  xleg = "topleft",
  legPar = list(),
  gap = 0,
  labels = NULL,
  ...
)

Arguments

x

Data frame with values of numeric variables.

by

Categorical variable that defines groups.

plotCI

Whether to plot confidence intervals or not, default is TRUE.

alpha

A confidence level for calculating confidence intervals (default is 0.05).

ylab

The title of y-axis.

xlab

The title of x-axis.

plotLegend

Whether to plot a legend or not, default is TRUE.

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 topleft.

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 matplot and axis.

Value

A list with the following elements:

Author(s)

Aleš Žiberna

Examples

plotMeans(x = mtcars[, c(1, 3, 5)], by = mtcars[,8])

[Package multiUS version 1.2.3 Index]