View source: R/isolate_branches.r
isolate_branch | R Documentation |
cuts of a branch at the nodes that match the lookup arguents (...). A "tree_parent" column is added to the tokenindex, that indicates for the new roots which node the parent was.
isolate_branch(tokens, ..., copy_parent = TRUE, copy_parent_fill = TRUE)
tokens |
A tokenindex |
... |
lookup arguments to find the node to split. For example, isolate_branch(tokens, relation='relcl') isolates branches of which the top node (the new root) has the relation "relcl". |
copy_parent |
If TRUE (default) copy the parent of the branch and include it in the isolated branch |
copy_parent_fill |
If TRUE, also copy the parents fill nodes |
the tokenindex
tokens = tokens_spacy[tokens_spacy$doc_id == 'text4',] tokens = as_tokenindex(tokens) tokens2 = isolate_branch(tokens, relation = 'relcl', copy_parent = TRUE) tokens2 if (interactive()) plot_tree(tokens2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.