clean {Read.isi}R Documentation

Cleans character strings from spaces at the start and end

Description

Clean is a helper function for the read.isi package. It deletes spaces at the start and the end of a single character string.

Usage

clean(x)

Arguments

x Single character string

Details

Can handle single character strings only. To use on a vector of characters x, use sapply(x, FUN=clean)

Value

Returns a character string

Author(s)

Rense Nieuwenhuis (contact@rensenieuwenhuis.nl)

References

More information on usage and background of the development can be found on www.rensenieuwenhuis.nl/r-project/my-functions/read-isi/

Examples


a <- "  messy string   "
clean(a)
#[1] "messy string"

b <- c("  First", "Second   ", " and last ...")
sapply(b, FUN=clean)
#         First      Second      and last ... 
#       "First"       "Second" "and last ..." 

d <- c("vfdgf'dre'3fv")
clean(d)
#[1] "vfdgf.dre.3fv"

[Package Read.isi version 0.5 Index]