View source: R/generic_reshape.r
remove_fill | R Documentation |
Like remove_nodes, but only removing the fill nodes
remove_fill( .tokens, node, rm_subset_fill = NULL, rm_subset = NULL, keep_shared = FALSE )
.tokens |
A tokenIndex in which nodes are selected with select_nodes. |
node |
The name of the node that is to be mutated |
rm_subset_fill |
A subset on the fill nodes. Can only directly use token column. For example, use pos == 'VERB' to remove only verbs |
rm_subset |
A subset expression (that evaluates to a logical vector) to more specifically specify which nodes to remove. The token column for each labeled node in the tquery can be referred to as label$column. |
keep_shared |
If there is another node that has the same fill nodes, should the fill nodes that are shared also be removed? |
A tokenIndex with a .nodes attribute
tokens = tokens_spacy[tokens_spacy$doc_id == 'text1',] ## use a tquery to label the nodes that you want to manipulate tq = tquery(pos = 'VERB', children(label = 'object', relation='dobj')) ## apply query to select nodes tokens2 = select_nodes(tokens, tq) remove_fill(tokens2, 'object')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.