Description Usage Arguments Details Value Note Examples
View source: R/mtg_getters_shortcuts.R
Get the value of one or several variables from the parent node. This is a helper
function that is usually used as input to mutate_mtg()
to get the values of the parent node
for all nodes.
1 2 3 4 5 6 7 8 9 |
attribute |
Any node attribute (as a character, an expression or a node callm see details) |
node |
The node (do not put something when used from |
scale |
An integer vector for filtering the MTG scale of the parent (i.e. the SCALE column from the MTG classes). |
symbol |
A character vector for filtering the names of the MTG symbol required for the parent (i.e. the SYMBOL column from the MTG classes). |
link |
A character vector for filtering the |
filter_fun |
Any filtering function taking a node as input, e.g. |
continue |
If a parent is not of the right |
The attribute
argument can be given as a string (e.g. attribute = "Length"), an
expression (e.g. attribute = Length) or a call to a node (e.g. attribute = node$Length).
All are equivalent because they evaluate the node given by the user or by the calling function.
This behavior is set to homogenize the grammar used in the calls of mutate_mtg()
.
The attribute values from the parent of a node
This function returns the values of any attribute of the parent of a node. It is
mainly intended to be used in a call to mutate_mtg()
(see mutate_mtg()
doc for examples).
1 2 3 | filepath= system.file("extdata", "simple_plant.mtg", package = "XploRer")
MTG = read_mtg(filepath)
parent(Length, node = extract_node(MTG, "node_5"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.