removeEmpty: removeEmpty removes empty strings from a vector of strings

View source: R/rutils.R

removeEmptyR Documentation

removeEmpty removes empty strings from a vector of strings

Description

removeEmpty removes empty strings from a vector of strings. Such spaces often created by spurious commas at the end of lines. It also removes strings made up only of spaces and removes spaces from inside of inidivdual chunks of text.

Usage

removeEmpty(invect)

Arguments

invect

vector of input strings, possibly containing empty strings

Value

a possibly NULL vector of strings

Examples

## Not run: 
x <- c("1","","2","","   ","3"," ","4","","a string","end")
x
length(x)
length(removeEmpty(x))
removeEmpty(x)

## End(Not run)

haddonm/codeutils documentation built on April 15, 2024, 1:02 p.m.