Learn R Programming

ggsurvey (version 1.0.0)

gghistweight2d_svy: Histogram of svy.object with One Facet

Description

In ggsurvey you specify both the plotting variables and weights in plain text with no quotes.

Usage

gghistweight2d_svy(surveyobj, x, y, binwidth = NULL)

Arguments

surveyobj

svy.design object

x

variable to histogram

y

categorical variable to facet

binwidth

binwidth to pass to geom_hist

Value

ggplot object

Examples

Run this code
# NOT RUN {
library(survey)
data(api)
dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)
gghistweight2d_svy(dstrat, api00, stype)
gghistweight2d_svy(dstrat, api00, stype, binwidth = 10)
# }

Run the code above in your browser using DataLab