pgplot: pgplot

View source: R/pgplot.R

pgplotR Documentation

pgplot

Description

Panel plot for surveys

Usage

pgplot(
  data,
  x,
  y,
  group,
  facet,
  year = "year",
  title = "DEFAULT TITLE",
  subtitle = "DEFAULT subtitle",
  ylab = "DEFAULT ylab",
  xlab = "DEFAULT xlab",
  caption = NULL,
  palette = "Dark2"
)

Arguments

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".

Details

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.)


AMGold99/piperr documentation built on March 29, 2022, 9:46 a.m.