Learn R Programming

grmtree (version 0.1.0)

apply_to_models: Internal Function: Apply Function to Models in Nodes

Description

Applies a function to the GRM models in specified nodes of a tree. This is an internal helper function and not meant to be called directly.

Usage

apply_to_models(object, node = NULL, FUN = NULL, drop = FALSE, ...)

Value

List of results (or single result if drop=TRUE and length(node)=1).

Arguments

object

A grmtree object.

node

Vector of node IDs (default: all nodes).

FUN

Function to apply to each model.

drop

Logical indicating whether to drop list structure if length 1.

...

Additional arguments passed to FUN.