qb_blocking {quickblock} | R Documentation |
Constructor for qb_blocking objects
Description
The qb_blocking
function constructs a qb_blocking
object from
existing block labels. The function does not derive blockings from
sets of data points; see quickblock
for that functionality.
Usage
qb_blocking(block_labels, unassigned_labels = NULL, ids = NULL)
Arguments
block_labels |
a vector containing each unit's block label. |
unassigned_labels |
labels that denote unassigned units. If |
ids |
IDs of the units. Should be a vector of the same length as
|
Details
qb_blocking
objects are based on integer vectors, and it indexes
the blocks starting with zero. The qb_blocking
class inherits
from the scclust
class.
Value
Returns a qb_blocking
object with the blocking described by the
provided labels.
Examples
# 10 units in 3 blocks
blocking1 <- qb_blocking(c("A", "A", "B", "C", "B",
"C", "C", "A", "B", "B"))
# 8 units in 3 blocks, 2 units unassigned
blocking2 <- qb_blocking(c(1, 1, 2, 3, 2,
NA, 3, 1, NA, 2))
# Custom labels indicating unassigned units
blocking3 <- qb_blocking(c("A", "A", "B", "C", "NONE",
"C", "C", "NONE", "B", "B"),
unassigned_labels = "NONE")
# Two different labels indicating unassigned units
blocking4 <- qb_blocking(c("A", "A", "B", "C", "NONE",
"C", "C", "0", "B", "B"),
unassigned_labels = c("NONE", "0"))
# Custom unit IDs
blocking5 <- qb_blocking(c("A", "A", "B", "C", "B",
"C", "C", "A", "B", "B"),
ids = letters[1:10])
[Package quickblock version 0.2.1 Index]