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

add_comma_space

Ensure Space After Comma


Description

Adds a space after a comma as strip and many other functions may consider a comma separated string as one word (i.e., "one,two,three" becomes "onetwothree" rather than "one two three").

Usage

add_comma_space(x)

Arguments

x

The text variable.

Value

Returns a vector of strings with commas that have a space after them.

Examples

## Not run: 
x <- c("the,  dog,went", "I,like,it", "where are you", NA, "why", ",", ",f")
add_comma_space(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.