replace_special_characters: Replace special characters in column names

replace_special_charactersR Documentation

Replace special characters in column names

Description

When using non-english languages, the column names of the document-term matrix can contain special characters. These might lead to encoding problems, when this matrix is used to train a machine learning model. This functions automatically replaces all special characters by the nearest equivalent character, e.g. "é" would be replaced by "e".

Usage

replace_special_characters(object)

## S4 method for signature 'MetaNLP'
replace_special_characters(object)

Arguments

object

An object of class MetaNLP.

Value

An object of class MetaNLP, where the column names do not have special characters anymore.

Examples

path <- system.file("extdata", "test_data.csv", package = "MetaNLP", mustWork = TRUE)
obj <- MetaNLP(path, language = "french")
obj <- replace_special_characters(obj)


MetaNLP documentation built on April 4, 2025, 5:11 a.m.