segplot {segregation} | R Documentation |
A visual representation of segregation
Description
Produces a segregation plot.
Usage
segplot(
data,
group,
unit,
weight,
order = "segregation",
secondary_plot = NULL,
reference_distribution = NULL,
bar_space = 0,
hline = NULL
)
Arguments
data |
A data frame. |
group |
A categorical variable or a vector of variables
contained in |
unit |
A categorical variable or a vector of variables
contained in |
weight |
Numeric. (Default |
order |
A character, either
"segregation", "entropy", "majority", or "majority_fixed".
Affects the ordering of the units.
The horizontal ordering of the groups can be changed
by using a factor variable for |
secondary_plot |
If |
reference_distribution |
Specifies the reference distribution, given as
a two-column data frame, to be plotted on the right.
If order is |
bar_space |
Specifies space between single units. |
hline |
Default |
Value
Returns a ggplot2 or patchwork object.