Learn R Programming

BrailleR (version 1.0.2)

hist: Create a standard histogram with a few extra elements added to the output object

Description

This function is a wrapper to the standard hist() function in the graphics package. It adds detail to the stored object so that a better text description can be formulated using the VI() method in the BrailleR package.

Usage

hist(x, ...)

Value

An object of class histogram as per the hist() function from the graphics package, with the addition of any calls to the main title or axis labels.

Arguments

x

a numeric variable.

...

additional arguments passed on to the plotting function.

Author

A. Jonathan R. Godfrey

Details

This function masks the function of the same name in the graphics package. Even though the base R implementation does create an object of class histogram, the object does not store all graphical arguments that are passed to the hist() function. The functionality should be no different at all for anyone who is not using the VI() function to gain a more detailed text description of the histogram. See the help page for the graphics::hist() function to get a more complete description of histogram creation.

References

Godfrey, A.J.R. (2013) ‘Statistical Software from a Blind Person's Perspective: R is the Best, but we can make it better’, The R Journal 5(1), pp73-79.

See Also

The base R implementation of the hist function should be consulted, using the entry in the graphics package

Examples

Run this code
x=rnorm(1000)
# the stamdard hist function returns
MyHist=graphics::hist(x, xlab="random normal values", main="Example histogram (graphics package)")
MyHist

# while this version returns
MyHist=hist(x, xlab="random normal values", main="Example histogram (BrailleR package)")
MyHist

# The VI() method then uses the extra information stored
VI(MyHist)

Run the code above in your browser using DataLab