nos.hist {NostalgiR}R Documentation

nos.hist text-based plot of a histogram.

Description

Plots a text-based of a histogram, with the option to plot densities or frequencies.

Usage

nos.hist(data, breaks = "Sturges", freq = T, xlab = NULL, ratio = 0.25,
  width = round(options()$width * 0.8), height = round(ratio * width),
  pch = "o")

Arguments

data

A numeric vector containing the values to be plotted. NA and NaN are allowed, but are removed for the plot. Infinities will cause an error.

breaks

Either a numerical value or a character string to specify the number of breaks to used. The default setting is 'Sturges', which is the default option in hist; see hist for other options.

freq

If TRUE, the y-coordinate will display frequencies. If FALSE, then the y-coordinate will display densities.

xlab

Label of the x-axis of the plot.

ratio

Coefficient that controls the aspect ratio of the plot.

width

Width of the plot in points.

height

Height of the plot in points.

pch

A single-character plot symbol.

Note

Due to rounding to a relatively crude grid results can only be approximate. The equally spaced axis ticks, for example, may be non-equally spaced in the plot. Further, due to the crude grid also there might be several points per character. The function uses the same plotting symbol no matter how many points coincide on one character position. Histogram columns are plotted at the midpoint of each bin.

Author(s)

Hien D. Nguyen

See Also

hist, and txtplot.

Examples

## Plot a histogram for the frequencies of 100 random standard normal points
## using 'Sturges' breaks and plot symbol 'o'.
data <- rnorm(100)
nos.hist(data)

## Plot a histogram for the densities of 1000 random chi-squared(3) points
## using 'FD' breaks and plot symbol '#'.
data <- rchisq(1000,3)
nos.hist(data,breaks='FD',freq=FALSE,pch='#')

[Package NostalgiR version 1.0.2 Index]