ggbarcrosstabs3d_svy {ggsurvey} | R Documentation |
Crosstabs of Three Variables Using svy.design object
Description
In ggsurvey you specify both the plotting variables and weights in plain text with no quotes.
Usage
ggbarcrosstabs3d_svy(surveyobj, x, y, z, fill = NULL, labeller = NULL)
Arguments
surveyobj |
svy.design obj |
x |
bar chart variable |
y |
crosstab variable 1 (horizontal facets) |
z |
crosstab variable 2 (vertical facets) |
fill |
if true the fill of each bar will be a different color corresponding to the level of the factor |
labeller |
argument to pass onto facet_grid |
Value
ggplot object
Examples
library(survey)
data(api)
dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)
ggbarcrosstabs3d_svy(dstrat, stype, yr.rnd, awards)
ggbarcrosstabs3d_svy(dstrat, stype, yr.rnd, awards, fill = TRUE)
data(nhanes)
design <- svydesign(id=~SDMVPSU, strata=~SDMVSTRA, weights=~WTMEC2YR, nest=TRUE,data=nhanes)
ggbarcrosstabs3d_svy(design, race, agecat, RIAGENDR)
[Package ggsurvey version 1.0.0 Index]