tCorpus$set_name {corpustools}R 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

[Package corpustools version 0.4.10 Index]