tCorpus$set_levels | R Documentation |
For factor columns, the levels can be changed directly (and by reference). This is particularly usefull for fast preprocessing (e.g., making tokens lowercase, )
column |
the name of the column |
levels |
The new levels |
Usage:
## R6 method for class tCorpus. Use as tc$method (where tc is a tCorpus object).
set_levels(column, levels)
set_meta_levels(column, levels)
tc = create_tcorpus(c('Text one first sentence. Text one second sentence', 'Text two'))
## change factor levels of a column in the token data
unique_tokens <- tc$get_levels('token')
tc$set_levels('token', toupper(unique_tokens))
tc$tokens
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.