qm_combine {qualmap}R Documentation

Combine objects

Description

A wrapper around dplyr::bind_rows for combining cluster objects created with qm_create into a single tibble. Input data for qm_combine are validated using qm_is_cluster as part of the cluster object creation process.

Usage

qm_combine(...)

Arguments

...

A list of cluster objects to be combined.

Value

A single tibble with all observations from the listed cluster objects. This tibble is stored with a custom class of qm_cluster to facilitate data validation.

See Also

qm_create, qm_is_cluster

Examples

# load and format reference data
stl <- stLouis
stl <- dplyr::mutate(stl, TRACTCE = as.numeric(TRACTCE))

# create clusters
cluster1 <- qm_define(118600, 119101, 119300)
cluster2 <- qm_define(119300, 121200, 121100)

# create cluster objects
cluster_obj1 <- qm_create(ref = stl, key = TRACTCE, value = cluster1,
    rid = 1, cid = 1, category = "positive")
cluster_obj2 <- qm_create(ref = stl, key = TRACTCE, value = cluster2,
    rid = 1, cid = 2, category = "positive")

# combine cluster objects
clusters <- qm_combine(cluster_obj1, cluster_obj2)


[Package qualmap version 0.2.2 Index]