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

Description Arguments Details Examples

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).

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
tc = create_tcorpus(sotu_texts, doc_column = 'id')

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

## 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$get_meta()

kasperwelbers/corpustools documentation built on Sept. 1, 2018, 1:03 p.m.