gghistweight2d {ggsurvey}R Documentation

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

Description

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

Usage

gghistweight2d(df, x, y, weights, binwidth = NULL)

Arguments

df

data frame

x

first variable of interest

y

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)
gghistweight2d(apistrat, api00, stype, pw)
gghistweight2d(apistrat, api00, stype, pw, binwidth = 10)

[Package ggsurvey version 1.0.0 Index]