facet_snake() splits a data frame by a grouping column and draws one
snake plot per group in a grid of panels, so that groups such as
participants, classes or conditions can be compared in the same display.
Each panel is drawn by FUN, by default activity_snake(), with the
group value as its title.
The panels are independent plots: each is scaled to its own data. The
grid is set with par(mfrow) and the previous graphical parameters are
restored afterwards. It returns, invisibly, a list with the value FUN
returned for each panel.
To draw groups of items (columns) rather than groups of rows, use the
facet argument of survey_snake().
Arguments
- data
A data frame. It is split by
facet_var, and each part, without the grouping column, is passed toFUNas its first argument.- facet_var
Name of the grouping column. Panels follow the order in which its values first appear.
- FUN
Plotting function for each panel (default
activity_snake()). It must take the data as its first argument and accept atitleargument;line_snake(),survey_snake(),survey_sequence()andsequential_dist()qualify.- ncol
Number of panel columns.
NULL(default) places all panels in one row.- ...
Further arguments passed to
FUN.
Value
The panels are drawn on the current device. The function returns,
invisibly, an unnamed list with one element per group, in order of first
appearance, holding the value FUN returned for that panel (a
snake_layout object for activity_snake()).
See also
activity_snake(), survey_snake() and its facet argument.
