tidyName: Clean Up Strings

View source: R/tidyName.R

tidyNameR Documentation

Clean Up Strings

Description

Remove spaces, punctuation, and capitalization from a string.

Usage

tidyName(x, fixes = c("_", ".", " ", "-", ">"), case = c("lower", "upper", "nochange"))

Arguments

x

The string to be modified.

fixes

Optional; a vector of all characters to be removed.

case

Optional; the case to which all characters in the string will be changed. There are three options: lower (the default), upper, and nochange.

Details

By default, underscores (_), periods (.), spaces ( ), dashes (-) and right angle bracket (>) will be removed from the string, and the string will be converted to all lowercase.

This function was intended for use in standardizing voucher names in make.unique.vouchers, so that punctuation, spacing, and capitalization differences in sequence metadata does not prevent the grouping of multiple sequences to a single specimen voucher (ie: Hipp_2016 vs. HIPP2016).

Value

The modified string is returned.

Author(s)

Andrew Hipp and Kasey Pham

See Also

make.unique.vouchers


andrew-hipp/morton documentation built on April 7, 2024, 12:15 p.m.