qm_matching | R Documentation |
The qm_matching
function constructs a qm_matching
object from
existing matched group labels. The function does not derive matchings from
sets of data points; see quickmatch
for that functionality.
qm_matching(group_labels, unassigned_labels = NULL, ids = NULL)
group_labels |
a vector containing each unit's group label. |
unassigned_labels |
labels that denote unassigned units. If |
ids |
IDs of the units. Should be a vector of the same length as
|
qm_matching
objects are based on integer vectors, and it indexes
matched groups starting with zero. The qm_matching
class inherits
from the scclust
class.
Returns a qm_matching
object with the matching described by the
provided labels.
# 10 units in 3 matched groups
matches1 <- qm_matching(c("A", "A", "B", "C", "B",
"C", "C", "A", "B", "B"))
# 8 units in 3 matched groups, 2 units unassigned
matches2 <- qm_matching(c(1, 1, 2, 3, 2,
NA, 3, 1, NA, 2))
# Custom labels indicating unassiged units
matches3 <- qm_matching(c("A", "A", "B", "C", "NONE",
"C", "C", "NONE", "B", "B"),
unassigned_labels = "NONE")
# Two different labels indicating unassiged units
matches4 <- qm_matching(c("A", "A", "B", "C", "NONE",
"C", "C", "0", "B", "B"),
unassigned_labels = c("NONE", "0"))
# Custom unit IDs
matches5 <- qm_matching(c("A", "A", "B", "C", "B",
"C", "C", "A", "B", "B"),
ids = letters[1:10])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.