Learn R Programming

qdap (version 2.4.6)

comma_spacer: 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

comma_spacer(text.var)

Value

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

Arguments

text.var

The text variable.

Examples

Run this code
if (FALSE) {
x <- c("the,  dog,went", "I,like,it", "where are you", NA, "why", ",", ",f")
comma_spacer(x)
}

Run the code above in your browser using DataLab