extractvar: Utilities for Multivariate Nodes

View source: R/extractvar.R

extractvarR Documentation

Utilities for Multivariate Nodes

Description

‘⁠extractvar⁠’ extracts one or more variates from a multivariate ‘⁠mcnode⁠’. ‘⁠addvar⁠’ combines consistent ‘⁠mcnode⁠’s into a single multivariate ‘⁠mcnode⁠’.

Usage

extractvar(x, which = 1)

addvar(...)

Arguments

x

a multivariate ‘⁠mcnode⁠’.

which

a vector specifying which variate(s) to extract.

...

‘⁠mcnode⁠’s to be combined in a multivariate ‘⁠mcnode⁠’. These ‘⁠mcnode⁠’s should be of the same type and dimension.

Details

The ‘⁠outm⁠’ attribute of the output of ‘⁠addvar⁠’ is taken from the first element.

Value

The new ‘⁠mcnode⁠’.

See Also

mcnode for ‘⁠mcnode⁠’ objects.

Examples

x <- mcdata(0:3, "0", nvariates = 4)
y <- extractvar(x, c(1, 3))
y
addvar(x, y)

mc2d documentation built on Oct. 23, 2026, 1:06 a.m.