plot_question: Generate a histogram of the responses to a single survey...

View source: R/plots.R

plot_questionR Documentation

Generate a histogram of the responses to a single survey question

Description

Using ggplot2, generate a plot object that will display a histogram of the responses to single survey item.

Usage

plot_question(d, question, labels = NULL, ymax = 1200)

Arguments

d

A data frame containing the source data

question

Which column in d to plot

labels

an optional list of labels for the question. This is usually the list of question options from the survey

ymax

The maximum y value (ylim) for the plot. This is used to ensure that a set of plots are comparable.

Value

A ggplot2 plot object containing a histogram


rwash/surveys documentation built on Sept. 18, 2023, 11:31 p.m.