| intersect_GroupAssignment | R Documentation |
You can intersect two GroupAssignment with this function.
intersect_GroupAssignment( GA1, GA2, force_disjoint = TRUE, force_exhaustive = FALSE )
GA1, GA2 |
GroupAssignment objects to intersect. No previously intersected objects can be intersected again. |
force_disjoint |
boolean indicating if groups disjointedness should be
forced in case when one observation would end in multiple intersections.
If |
force_exhaustive |
boolean indicating if elements that are not assigned
to any of the intersecting groups should be gathered together in |
GroupAssignment object with intersected groups.
Other observation grouping functions:
GroupAssignment(),
extract_observations()
sex_grouping <- GroupConditions(
conditions_category = "Sex",
"M" ~ sex == "M",
"F" ~ sex == "F",
"O" ~ !sex %in% c("M", "F")
)
age_grouping <- GroupConditions(
conditions_category = "Age",
"to 20" ~ age < 20,
"20 to 40" ~ age >= 20 & age <= 40,
"40 to 60" ~ age >= 40 & age < 60,
force_exhaustive = TRUE,
force_disjoint = FALSE
)
# intersect two distinct GroupAssignements
intersected <- intersect_GroupAssignment(
GA1 = GroupAssignment(HEXACO_60, sex_grouping),
GA2 = GroupAssignment(HEXACO_60, age_grouping),
force_exhaustive = TRUE,
force_disjoint = FALSE
)
summary(intersected)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.