Description Usage Arguments Details Value Note Examples
Get attribute values from the nodes that are decomposing a node (e.g. the growing units decomposing an axis).
1 2 3 4 5 6 7 8 9 |
attribute |
Any node attribute (as a character) |
node |
The MTG node |
decomp_type |
Match the node scale or symbol for decomposition ? If symbol, the function will return all descendants until matching the same symbol than the node, if scale it will do the same until matching the same scale. |
scale |
An integer vector for filtering the |
symbol |
A character vector for filtering the decomposing nodes by the name of their |
link |
A character vector for filtering the |
filter_fun |
Any filtering function taking a node as input. |
This function is mainly used to summarize attributes at a higher scale when they were measured at a lower scale. For example we can think of an mtg where the length was measured at the internode scale only, so this function can be used to summarize it at e.g. axis scale. The filters are used to get the nodes of interest only. For example an axis can be made of internodes and leaves, but the length of an axis is made from the cumulative length of the internodes only (not the leaves). A second example would be to summarize the total leaf area per axis, where we would only want to use the area of the leaves (not the internodes).
The attribute values from the nodes decomposing the input node
This function is mainly intended to be used with mutate_mtg()
. In this case,
the node
argument can be left empty (or you can put node = node
equivalently).
1 2 3 4 5 6 7 8 9 10 11 | filepath= system.file("extdata", "simple_plant_3.mtg", package = "XploRer")
MTG = read_mtg(filepath)
decompose(".symbol", node = extract_node(MTG,"node_3"), decomp_type = "symbol")
# using filters to remove nodes that we don't need:
decompose(".symbol", node = extract_node(MTG,"node_3"), symbol = "Internode",
decomp_type = "symbol")
# We can check the function worked properly by printing the symbols of each nodes:
print(MTG, ".symbol")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.