Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tCorpus-cash-feats_to_columns

Cast the "feats" column in UDpipe tokens to columns


Description

If the UDpipe parser is used in create_tcorpus, the 'feats' column contains strings with features (e.g, Number=Sing|PronType=Dem). To work with these nested features it is more convenient to cast them to columns.

Arguments

keep

Optionally, the names of features to keep

drop

Optionally, the names of features to drop

rm_column

If TRUE (default), remove the original column

Details

Usage:

## R6 method for class tCorpus. Use as tc$method (where tc is a tCorpus object).

feats_to_columns(keep=NULL, drop=NULL, rm_column=TRUE)

Examples

if (interactive()) {
tc = create_tcorpus('This is a test Bobby.', udpipe_model='english-ewt')
tc$feats_to_columns()
tc$tokens

tc = create_tcorpus('This is a test Bobby.', udpipe_model='english-ewt')
tc$feats_to_columns(keep = c('Gender','Tense','Person'))
tc$tokens
}

corpustools

Managing, Querying and Analyzing Tokenized Text

v0.4.10
GPL-3
Authors
Kasper Welbers and Wouter van Atteveldt
Initial release
2022-05-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.