tCorpus-cash-set_name: Change column names of data and meta data

tCorpus$set_nameR Documentation

Change column names of data and meta data

Description

Usage:

Arguments

oldname

the current/old column name

newname

the new column name

Details

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

set_name(oldname, newname)
set_meta_name(oldname, newname)

Examples

tc = create_tcorpus(sotu_texts[1:5,], doc_column = 'id')

## change column name in token data
tc$names ## original column names
tc$set_name(oldname = 'token', newname = 'word')
tc$tokens

## change column name in meta data
tc$meta_names ## original column names
tc$set_meta_name(oldname = 'party', newname = 'clan')
tc$set_meta_name(oldname = 'president', newname = 'clan leader')
tc$meta

corpustools documentation built on May 31, 2023, 8:45 p.m.