taxlist (version 0.2.4)

clean_strings: Cleaning character strings.

Description

Multiple, leading and trailing white spaces as well as wrong encodings may cause serious problems in information dealing with taxonomic names. The function clean_strings get rid of them.

Usage

clean_strings(x, ...)

# S4 method for character clean_strings(x, from = "utf8", to = "utf8", ...)

# S4 method for factor clean_strings(x, from = "utf8", to = "utf8", ...)

# S4 method for data.frame clean_strings(x, from = "utf8", to = "utf8", ...)

Value

The same as input x.

Arguments

x

Object to be cleaned.

...

Further arguments passed among methods (not yet in use).

from, to

Arguments passed to iconv().

Author

Miguel Alvarez.

Details

This function automatically deletes leading, trailing and multiple white spaces, either in strings (method character), levels (method factor or in single columns (method data.frame).

Examples

Run this code
## Leading, trailing and multiple spaces
clean_strings(" Cyperus    papyrus L.     ")

Run the code above in your browser using DataLab