This function is used within the aggregate_rsyntax function to facilitate aggregating by specific labels.
Usage
agg_label(label, ...)
Value
Not relevant. Should only be used within aggregate_rsyntax
Arguments
label
The rsyntax label. Needs to be an existing value in the annotation column (as specified when calling aggregate_rsyntax)
...
Specify the new aggregated columns in name-value pairs. The name is the name of the new column, and the value should be a function over a column in $tokens.
For example: subject = paste(token, collapse = ' ') would create the column 'subject', of which the values are the concatenated tokens. See examples for more.
tc = tc_sotu_udpipe$copy()
tc$udpipe_clauses()
## count number of tokens in predicateaggregate_rsyntax(tc, 'clause', txt=FALSE,
agg_label('predicate', n = length(token_id)))