replace_kern: Replace Kerned (Spaced) with No Space Version

Description Usage Arguments Value Author(s) References Examples

View source: R/replace_kerning.R

Description

In typography kerning is the adjustment of spacing. Often, in informal writing, adding manual spaces (a form of kerning) coupled with all capital letters is used for emphasis. This tool looks for 3 or more consecutive capital letters with spaces in between and removes the spaces. Essentially, the capitalized, kerned version is replaced with the word equivalent.

Usage

1

Arguments

x

The text variable.

...

ignored.

Value

Returns a vector with kern spaces removed.

Author(s)

StackOverflow user @ctwheels

References

https://stackoverflow.com/a/47438305/1000343

Examples

1
2
3
4
5
6
7
8
x <- c(
    "Welcome to A I: the best W O R L D!",
    "Hi I R is the B O M B for sure: we A G R E E indeed.",
    "A sort C A T indeed!",
    NA
)

replace_kern(x)

Example output

[1] "Welcome to A I: the best WORLD!"              
[2] "Hi I R is the BOMB for sure: we AGREE indeed."
[3] "A sort CAT indeed!"                           
[4] NA                                             

textclean documentation built on May 2, 2019, 7:22 a.m.