specify_positions | R Documentation |
Function to create positions for a figure based on the combination of grouping factors in a data frame.
specify_positions(dtf, spacing = c(0.25, 0.25), as_list = FALSE)
dtf |
A data frame with separate columns for each grouping variable. |
spacing |
A numeric vector of two values, the gap to add between groups and at the beginning and end for plotting limits (given as a proportion). |
as_list |
Logical; if |
A numeric vector of values. If as_list
is
TRUE
, a list with two vectors, one for the positions
and one with the lower and upper limits for the plotting
boundaries.
# Example data set
data("mtcars")
dtf <- stats_by_group( mtcars, 'mpg', c( 'vs', 'am' ) )
specify_positions( dtf[, 1:2] )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.