pgplot | R Documentation |
Panel plot for surveys
pgplot( data, x, y, group, facet, year = "year", title = "DEFAULT TITLE", subtitle = "DEFAULT subtitle", ylab = "DEFAULT ylab", xlab = "DEFAULT xlab", caption = NULL, palette = "Dark2" )
data |
Dataframe. |
x |
Variable to be mapped on the x-axis |
y |
Variable to be mapped on the y-axis |
group |
Group variable (e.g., ethnicity), which will be delineated by color |
facet |
Variable on which the plot panels (facets) will be based. Survey response is a sensible choice. |
year |
Variable name denoting year. Defaults to "year". |
title |
Plot title, as character string |
subtitle |
Plot subtitle, as character string |
ylab |
Label for y-axis, as character string |
xlab |
Label for x-axis, as character string |
caption |
Optional. Caption will be placed below plot. |
palette |
palette from RColorBrewer. See here for all palette options. Defaults to "Dark2". |
Creates multi-panel plot for survey response visualizations. Performs best when survey response strings are short and there are no more than 6 unique response values. (Name meaning: p for panel, g for gg, as in ggplot.)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.