gghistweight3d: Weighted Histogram with Two Facets

View source: R/histograms.R

gghistweight3dR Documentation

Weighted Histogram with Two Facets

Description

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

Usage

gghistweight3d(df, x, y, z, weights, binwidth = NULL)

Arguments

df

data frame

x

first variable of interest

y

first categorical variable for faceting

z

second categorical variable for faceting

weights

survey weights that sum to sample size

binwidth

desired binwidth, if NULL bins in geom_histogram defaults to 30

Value

ggplot object

Examples

library(survey)
data(api)
gghistweight3d(apistrat, api00, stype, awards, pw)
gghistweight3d(apistrat, api00, stype, awards, pw, binwidth = 10)

ggsurvey documentation built on May 4, 2022, 9:06 a.m.