get_parents {funMoDisco}R Documentation

Get Parent Nodes from a Given Node

Description

This function identifies the parent nodes of a given node in a hierarchical structure. It checks which nodes in the provided list contain the specified node, thereby determining its parent nodes.

Usage

get_parents(node, node_list)

Arguments

node

A vector representing a single node whose parents are to be found. It is expected to contain the elements that may be present in the parent nodes.

node_list

A list of vectors, where each vector represents a node in the hierarchical structure. The function will search through these nodes to find parents of the specified node.

Details

The function works by applying a logical check across the 'node_list'. It returns the indices of all nodes that contain all elements of the specified node vector. If no parent nodes are found, the function will return an empty integer vector.

Value

A numeric vector containing the indices of the parent nodes in the 'node_list' that include the specified node.


[Package funMoDisco version 1.0.0 Index]