hist.data.frame: Histograms for Variables in a Data Frame

Description Usage Arguments Value Author(s) See Also Examples

View source: R/hist.data.frame.s

Description

This functions tries to compute the maximum number of histograms that will fit on one page, then it draws a matrix of histograms. If there are more qualifying variables than will fit on a page, the function waits for a mouse click before drawing the next page.

Usage

1
2
3
## S3 method for class 'data.frame'
hist(x, n.unique = 3, nclass = "compute",
                na.big = FALSE, rugs = FALSE, freq=TRUE, mtitl = FALSE, ...)

Arguments

x

a data frame

n.unique

minimum number of unique values a variable must have before a histogram is drawn

nclass

number of bins. Default is max(2,trunc(min(n/10,25*log(n,10))/2)), where n is the number of non-missing values for a variable.

na.big

set to TRUE to draw the number of missing values on the top of the histogram in addition to in a subtitle. In the subtitle, n is the number of non-missing values and m is the number of missing values

rugs

set to TRUE to add rug plots at the top of each histogram

freq

see hist. Default is to show frequencies.

mtitl

set to a character string to set aside extra outside top margin and to use the string for an overall title

...

arguments passed to scat1d

Value

the number of pages drawn

Author(s)

Frank E Harrell Jr

See Also

hist, scat1d

Examples

1
2
3
d <- data.frame(a=runif(200), b=rnorm(200),
                w=factor(sample(c('green','red','blue'), 200, TRUE)))
hist.data.frame(d)   # in R, just say hist(d)

Example output

Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2

Attaching package: 'Hmisc'

The following objects are masked from 'package:base':

    format.pval, round.POSIXt, trunc.POSIXt, units

Hmisc documentation built on Oct. 7, 2021, 9:16 a.m.