ggbarcrosstabs3d {ggsurvey} | R Documentation |
Crosstabs of Three Variables
Description
In ggsurvey you specify both the plotting variables and weights in plain text with no quotes.
Usage
ggbarcrosstabs3d(df, x, y, z, weights, fill = NULL, labeller = NULL)
Arguments
df |
data frame |
x |
bar chart variable |
y |
crosstab variable 1 (horizontal facets) |
z |
crosstab variable 2 (vertical facets) |
weights |
survey weights that sum to sample size |
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 pbject
Examples
library(survey)
data(api)
ggbarcrosstabs3d(apistrat, stype, yr.rnd, awards, pw)
ggbarcrosstabs3d(apistrat, stype, yr.rnd, awards, pw, TRUE)
data(nhanes)
ggbarcrosstabs3d(nhanes, race, agecat, RIAGENDR, WTMEC2YR)
[Package ggsurvey version 1.0.0 Index]