Learn R Programming

survey (version 3.3-2)

svyhist: Histograms

Description

Draws a histogram weighted by the sampling weights.

Usage

svyhist(formula, design, xlab = NULL, main = NULL,
  probability=TRUE,freq=!probability, ...)

Arguments

formula
One-sided formula giving the variable to plot
design
A survey design object
xlab
x-axis label
main
Main title
probability,freq
Y-axis is probability density or frequency
...
Other arguments to hist

See Also

svyplot

Examples

Run this code
data(api)
dstrat <- svydesign(id = ~1, strata = ~stype, weights = ~pw, data = apistrat, 
    fpc = ~fpc)
svyhist(~ell, dstrat, main="English language learners",col="peachpuff")

Run the code above in your browser using DataLab