segplot | R Documentation |
Produces a segregation plot.
segplot(
data,
group,
unit,
weight,
order = "segregation",
reference_distribution = NULL,
bar_space = 0,
title = NULL,
axis_labels = "left"
)
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 |
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. |
title |
Adds a plot title and appends the value of the H index. |
axis_labels |
One of "left", "right", or "both". Determines where the y axis labels are placed. |
Returns a ggplot2 object.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.