Learn R Programming

xpose.xtras (version 0.0.2)

expose_param: Expose a model parameter of xpdb objects in an xpose_set

Description

Expose a model parameter of xpdb objects in an xpose_set

Usage

expose_param(xpdb_s, ..., .problem = NULL, .subprob = NULL, .method = NULL)

Value

An xpose_set object with the parameter exposed

Arguments

xpdb_s

<xpose_set> An xpose_set object

...

<dynamic-dots> One or more parameter to expose, using selection rules from add_prm_association.

.problem

<numeric> Problem number to apply this relationship.

.subprob

<numeric> Problem number to apply this relationship.

.method

<numeric> Problem number to apply this relationship.

Details

The parameter returned will be top-level, and to avoid conflicting names will be prepended by .. (e.g., ..ome1). The selector used to fetch the parameter will be used in this .. name. If a better name is preferred, there are convenient renaming functions from dplyr where needed.

When using parameter selectors, quotations should be used for more complex names, like "OMEGA(1,1)", since these may be read incorrectly otherwise.

The untransformed parameter is used for this exposure. The get_prm call uses transform=FALSE.

See Also

expose_property()

Examples

Run this code

pheno_set %>%
  expose_param(the1) %>%
  reshape_set()


pheno_set %>%
  expose_param(RUVADD, "OMEGA(1,1)") %>%
  reshape_set()

# This function is useful for generating a model-building table
pheno_set %>%
  # Determine longest lineage
  select(all_of(xset_lineage(.))) %>%
  # Select key variability parameters
  expose_param(RUVADD, "OMEGA(1,1)") %>%
  # Make sure all models have descriptions
  focus_qapply(desc_from_comments) %>%
  # Extract description
  expose_property(descr) %>%
  # Transform to tibble
  reshape_set() # %>% pipe into other processing

Run the code above in your browser using DataLab