v_assign_meta: Assign a vector of metadata to a corpus

View source: R/utils_for_tm.R

v_assign_metaR Documentation

Assign a vector of metadata to a corpus

Description

This function provide the possibility to assign a vector of metadata (one each document) to a copus in one command. To assign a single metadata to a single document or to the whole corpuse use the standard meta.

Usage

v_assign_meta(corpus, meta_name, meta_content)

Arguments

corpus

A VCorpus

meta_name

A character vector representing the name of meta to consider

meta_content

A vector or a list of data of length of corpus containing the corresponding meta data content to assign each one

Value

A VCorpus (invisible) with metadata updated

Examples

data(liu_4h28)

corpus <- create_train(data_df = liu_4h28, name_df = 'Liu')
corpus <- v_assign_meta(corpus, 'author', liu_4h28$authors)

UBESP-DCTV/costumer documentation built on Feb. 1, 2023, 4:52 a.m.