flattenDeepEntity: Flattens Nested ACAS Entities

View source: R/JSON_library.R

flattenDeepEntityR Documentation

Flattens Nested ACAS Entities

Description

Gets values within nested ACAS entities

Usage

flattenDeepEntity(entity, desiredAcasCategory,
  currentAcasCategory = "experiment", includeFromState = c("id", "lsType",
  "lsKind"), includeFromEntity = c("id"))

Arguments

entity

an ACAS entity such as a protocol or subject

desiredAcasCategory

acasCategory where the desired values are stored

currentAcasCategory

acasCategory of the entity provided

includeFromState

a character vector of column names to include from the state

includeFromEntity

a character vector of column names to include from the state

Details

flattenDeepEntity pulls values out of nested objects. This can be used on any ACAS object that has lsStates that have lsValues. If no information is needed from the state or entity, includeFromState and includeFromEntity, respectively, can be set to an empty list, c(). Columns in includeFromState will have "state" prepended and the first letter capitalized, while columns in includeFromEntity will have acasCategory prepended and the first letter capitalized. The list of ACAS categories can be found in racas::acasEntityHierarchy (acasEntityHierarchy)

Examples

## Not run: 
experiment <- getExperimentByCodeName("EXPT-00012398", include = "fullobject")
x <- flattenDeepEntity(experiment, "subject", "experiment")

## End(Not run)

mcneilco/racas documentation built on April 19, 2024, 1:12 p.m.