Learn R Programming

nCopula (version 0.1.1)

Node: Obtain a node in mother class object

Description

Use a path (numeric vector) to obtain a subgroup of a structure (mother class object).

Usage

Node(path, structure)

Arguments

path

the path of the node (numeric vector).

structure

a mother class object (S4).

Value

Either a child or mother class object.

Details

Every node of a mother object (structure) can be identified with a numeric vector that indicates the path used from the root to the node. The vector is the 'path' argument and is used to find specific nodes of a given structure. For a complete explanation, we refer to Cossette et al. (2017).

Examples

Run this code
# NOT RUN {
# We directly give the path of the desired node.
Node(c(0,2,2), LOG(0.5, NULL, list(GAMMA(1/30, c(5,6), NULL),
                              LOG(0.1, NULL, list(GAMMA(1/30, c(1,2), NULL),
                              GAMMA(1/30, c(3,4), NULL))))))

# Here we provide the path with the GeneticCodes function of this package.
structure <- LOG(0.5, NULL, list(GAMMA(1/30, c(5,6), NULL),
                                     LOG(0.1, NULL, list(GAMMA(1/30, c(1,2), NULL),
                                     GAMMA(1/30, c(3,4), NULL)))))
Node(GeneticCodes(structure)[[3]], structure)

# }

Run the code above in your browser using DataLab