trim: Remove redundant white space.

Description Usage Arguments Value Examples

Description

Remove whitespace from a character or vector. Note that this will always return a character.

Usage

1
trim(x)

Arguments

x

is the value to be trimmed

Value

a value without any extra whitespace

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
trim('This value      has    an unnecessary amount    of whitespace    ')

## Performing the trim function on a vector
iris$Species <- paste(iris$Species,'    Species',sep='')
head(iris)
## Correct the whitespacing
iris$Species <- trim(iris$Species)
## View our corrected dataframe
head(iris)
rm(iris)

moone009/tmp_preprocess documentation built on May 23, 2019, 6:10 a.m.