barplot.svystat {survey}R Documentation

Barplots

Description

Draws a barplot based on results from a survey analysis. The default barplot method already works for results from svytable.

Usage

## S3 method for class 'svystat':
barplot(height, ...)

## S3 method for class 'svrepstat':
barplot(height, ...)

## S3 method for class 'svyby':
barplot(height,beside=TRUE, ...)

Arguments

height Analysis result
beside Grouped, rather than stacked, bars
... Arguments to barplot

Examples


data(api)
dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)

a<-svymean(~stype, dclus1)
barplot(a)
barplot(a, names.arg=c("Elementary","High","Middle"), col="purple", main="Proportions of school level")

b<-svyby(~enroll+api.stu, ~stype, dclus1, svymean)
barplot(b,beside=TRUE,legend=TRUE)


[Package survey version 3.10 Index]