cdb_unnest: Unnest a COM(P)ADRE database by spreading the components of...

View source: R/cdb_unnest.R

cdb_unnestR Documentation

Unnest a COM(P)ADRE database by spreading the components of CompadreMat into separate list-columns

Description

Unnests a CompadreDB object by spreading the components of CompadreMat into separate list-columns. Components that may be extracted include:

  • matA (matrix)

  • matU (matrix)

  • matF (matrix)

  • matC (matrix)

  • MatrixClassAuthor (character vector)

  • MatrixClassOrganized (character vector)

  • MatrixClassNumber (integer vector)

Usage

cdb_unnest(
  cdb,
  components = c("matA", "matU", "matF", "matC", "MatrixClassAuthor",
    "MatrixClassOrganized", "MatrixClassNumber")
)

Arguments

cdb

A CompadreDB object

components

Character vector specifying which components to extract.

Defaults to all, i.e. c("matA", "matU", "matF", "matC", "MatrixClassAuthor", "MatrixClassOrganized", "MatrixClassNumber")

Value

cdb with additional list-columns for each element of argument components

Author(s)

Patrick M. Barks <patrick.barks@gmail.com>

See Also

Other data management: cdb_flatten(), cdb_id_stages(), cdb_id_studies(), cdb_id(), cdb_mean_matF(), cdb_rbind(), cdb_unflatten(), mpm_elementwise_apply(), mpm_mean(), mpm_median(), mpm_sd(), string_representation

Examples

# unnest all components
CompadreUnnest <- cdb_unnest(Compadre)

# unnest select components (matU and MatrixClassAuthor)
CompadreUnnest <- cdb_unnest(Compadre, c("matU", "MatrixClassAuthor"))


Rcompadre documentation built on Oct. 17, 2024, 1:07 a.m.