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

replace_contraction

Replace Contractions


Description

This function replaces contractions with long form.

Usage

replace_contraction(x, contraction.key = lexicon::key_contractions,
  ignore.case = TRUE, ...)

Arguments

x

The text variable.

contraction.key

A two column hash of contractions (column 1) and expanded form replacements (column 2). Default is to use key_contractions data set.

ignore.case

logical. Should case be ignored?

...

ignored.

Value

Returns a vector with contractions replaced.

Examples

## Not run: 
x <- c("Mr. Jones isn't going.",  
    "Check it out what's going on.",
    "He's here but didn't go.",
    "the robot at t.s. wasn't nice", 
    "he'd like it if i'd go away")

replace_contraction(x)

## End(Not run)

textclean

Text Cleaning Tools

v0.9.3
GPL-2
Authors
Tyler Rinker [aut, cre], ctwheels StackOverflow [ctb]
Initial release

We don't support your browser anymore

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