powered by
In ggsurvey you specify both the plotting variables and weights in plain text with no quotes.
gghistweight(df, x, weights, binwidth = NULL)
data frame
variable of interest
survey weights that sum to sample size
desired binwidth, if NULL bins in geom_histogram defaults to 30
ggplot object
# NOT RUN { library(survey) data(api) gghistweight(apistrat, api00, pw) gghistweight(apistrat, api00, pw, binwidth = 10) data(election) gghistweight(election_pps, Bush, p) # }
Run the code above in your browser using DataLab