Learn R Programming

NostalgiR (version 1.0.2)

nos.hist: 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.

See Also

hist, and txtplot.

Examples

Run this code
## 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='#')

Run the code above in your browser using DataLab