zapspace | R Documentation |
This eliminates any characters matched by the regular expression
'\s' if they appear at the beginning of a string or at its
end. It does not alter spaces in the interior of a string. This
was created when I was not aware of R's trimws
and the purpose
is the same. On our TODO list, we intend to eliminate this function
and replace its use with trimws
zapspace(x)
x |
A character vector |
If x is a character vector, return is a character vector with leading and trailing white space values removed. If x is not a character vector, an unaltered x is returned.
Paul Johnson <pauljohn@ku.edu>
x <- c("", " ", " ", "\t", "\t some", "some\t", " space first")
zapspace(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.