Learn R Programming

RBERT (version 0.1.11)

apply_to_chars: Apply a function to each character in a string.

Description

Utility function for something done a lot in this package.

Usage

apply_to_chars(text, .f, ...)

Arguments

text

A character scalar to process.

.f

The function to apply to each character. Should return a character scalar, given a single-character input.

...

Other arguments to pass to .f.

Value

The character scalar obtained by applying the given function to each character of the input string, and concatenating the results.