ggbarcrosstabs3d | R Documentation |
In ggsurvey you specify both the plotting variables and weights in plain text with no quotes.
ggbarcrosstabs3d(df, x, y, z, weights, fill = NULL, labeller = NULL)
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 |
ggplot pbject
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.