Learn R Programming

MetaNLP (version 0.1.4)

replace_special_characters: 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 MetaNLP replace_special_characters(object)

Value

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

Arguments

object

An object of class MetaNLP.

Examples

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

Run the code above in your browser using DataLab