Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

content_transformer

Content Transformers


Description

Create content transformers, i.e., functions which modify the content of an R object.

Usage

content_transformer(FUN)

Arguments

FUN

a function.

Value

A function with two arguments:

x

an R object with implemented content getter (content) and setter (content<-) functions.

...

arguments passed over to FUN.

See Also

tm_map for an interface to apply transformations to corpora.

Examples

data("crude")
crude[[1]]
(f <- content_transformer(function(x, pattern) gsub(pattern, "", x)))
tm_map(crude, f, "[[:digit:]]+")[[1]]

tm

Text Mining Package

v0.7-8
GPL-3
Authors
Ingo Feinerer [aut, cre] (<https://orcid.org/0000-0001-7656-8338>), Kurt Hornik [aut] (<https://orcid.org/0000-0003-4198-9911>), Artifex Software, Inc. [ctb, cph] (pdf_info.ps taken from GPL Ghostscript)
Initial release
2020-11-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.