nodeids | R Documentation |
Extract unique identifiers from inner and terminals nodes of "etree"
or "partynode"
objects.
nodeids(obj, ...) ## S3 method for class 'partynode' nodeids(obj, from = NULL, terminal = FALSE, ...) ## S3 method for class 'etree' nodeids(obj, from = NULL, terminal = FALSE, ...)
obj |
Object of class |
... |
Additional arguments. |
from |
Integer specifying the node to start from. |
terminal |
Logical indicating whether only identifiers of terminal nodes
should be returned ( |
An integer vector of node identifiers.
partynode
: nodeids() method for objects of class "partynode".
etree
: nodeids() method for objects of class "etree".
## Covariates nobs <- 100 cov_num <- rnorm(nobs) cov_nom <- factor(rbinom(nobs, size = 1, prob = 0.5)) cov_gph <- lapply(1:nobs, function(j) igraph::sample_gnp(100, 0.2)) cov_fun <- fda.usc::rproc2fdata(nobs, seq(0, 1, len = 100), sigma = 1) cov_list <- list(cov_num, cov_nom, cov_gph, cov_fun) ## Response variable resp_reg <- cov_num ^ 2 ## Fit etree_fit <- etree(response = resp_reg, covariates = cov_list) ## Get all nodes identifiers nodes_ids <- nodeids(etree_fit) ## Get terminal nodes identifiers tnodes_ids <- nodeids(etree_fit, terminal = TRUE) ## Get all nodes identifiers starting from 2 nodes_ids2 <- nodeids(etree_fit, from = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.