histSPSS: Histogram

Description Usage Arguments Value Author(s) Examples

View source: R/plots.R

Description

Draw a histogram of a variable in a data frame. The plot thereby mimics the look of SPSS graphs.

Usage

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

Arguments

data

a data frame containing the variable to be plotted.

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

xlab, ylab

the axis labels (the default is to use the variable name for the x-axis label and "Frequency" as the y-axis label).

...

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

Value

An object of class "histogram" is returned invisibly (see hist).

Author(s)

Andreas Alfons

Examples

1
2
3
4
5
6
7
# load data
data("Eredivisie")
# log-transform market values
Eredivisie$logMarketValue <- log(Eredivisie$MarketValue)

# plot histogram of log market values
histSPSS(Eredivisie, "logMarketValue")

r2spss documentation built on Nov. 25, 2021, 1:06 a.m.