r2spss-deprecated: Deprecated plot functions in r2spss

r2spss-deprecatedR Documentation

Deprecated plot functions in r2spss

Description

These plot functions are deprecated and may be removed as soon as the next release of r2spss. The functions plotSPSS, linesSPSS, boxSPSS, and histSPSS are built around base R graphics and have been superseded by functions built on ggplot2.

Usage

plotSPSS(data, variables, xlab = NULL, ylab = NULL, ...)

linesSPSS(data, variables, index = NULL, xlab = NULL, ylab = NULL, ...)

boxplotSPSS(
  data,
  variables,
  group = NULL,
  xlab = NULL,
  ylab = NULL,
  cut.names = NULL,
  ...
)

histSPSS(data, variable, normal = FALSE, xlab = NULL, ylab = NULL, ...)

Arguments

data

a data frame containing the variables to be plotted.

variables

For plotSPSS, a character vector specifying at least two variables to be plotted. In case of two variables, a simple scatter plot is produced with the first variable on the x-axis and the second variable on the y-axis. In case of more than two variables, a scatter plot matrix is produced.

For linesSPSS, a character vector specifying at least one variable to be plotted on the y-axis. In case of multiple variables, separate lines are drawn for each variable and a legend is shown.

For boxplotSPSS, a character vector specifying separate variables to be plotted. If group is not NULL, only the first variable is used and box plots of groups of observations are drawn instead.

xlab, ylab

the axis labels.

...

additional arguments to be passed down, in particular graphical parameters (see boxplot, hist, and par).

index

a character string specifying a variable to be plotted on the x-axis, or NULL to plot the observations against their index.

group

an character string specifying a grouping variable, or NULL for no grouping.

cut.names

a logical indicating whether to cut long variable names or group labels to 8 characters. The default is TRUE for box plots of separate variables, but FALSE for box plots of groups of observations (which mimics SPSS behavior).

variable

a character string specifying the variable to be plotted.

normal

a logical indicating whether to add a normal density with the estimated mean and standard deviation (the default is FALSE).

Details

plotSPSS draws a scatter plot or a scatter plot matrix of variables in a data frame.

linesSPSS draws connected lines for variables in a data frame.

boxplotSPSS draw box plots of variables in a data frame, including box plots for groups of observations and box plots for separate variables.

histSPSS draws a histogram of a variable in a data frame.

The plots thereby mimic the look of graphs in older versions of SPSS (<24).

Value

plotSPSS and linesSPSS do not return anything but produce a plot.

boxplotSPSS returns a list containing summary statistics invisibly (see boxplot) and produces a plot.

histSPSS returns an object of class "histogram" invisibly (see hist) and produces a plot.

Author(s)

Andreas Alfons


r2spss documentation built on May 25, 2022, 5:05 p.m.