nameAlnum: Utility functions, mostly for character manipulation

Description Usage Arguments Value Author(s) See Also Examples

Description

Utility functions, mostly for character manipulation.

Usage

1
2
3
4
pasteDate(..., sep = " ", collapse = NULL, sep.date = sep)
paste0date(..., collapse = NULL)
nameAlnum(x, capitalize=c("asis", "first", "none", "all", "mixed"), 
    collapse=" ")

Arguments

x

a (character) vector.

...

one or more R objects, to be converted to character vectors.

sep

a character string to separate the terms.

collapse

an optional character string to separate the results. For nameAlnum it is the separator between the words in the output.

sep.date

a character string to separate the terms from the data itself.

capitalize

character, which letter of each words should be capitalized. "mixed" capitalizes the first letter and case is unchanged for the rest. "first" capitalizes first letter and uses lower case for the rest. Other options are self explanatory.

Value

Character vector.

Author(s)

Peter Solymos <solymos@ualberta.ca>

See Also

paste, paste0, strsplit, gsub

Examples

1
2
3
4
5
6
7
paste0(pasteDate("file", "name", sep="-", sep.date="_"), ".csv")
paste0(paste0date("file", "name", sep.date="_"), ".csv")

data(abmibirds)
x <- data.frame(Name=levels(abmibirds[["Common.Name"]]),
    NameAlnum=nameAlnum(levels(abmibirds[["Common.Name"]])))
x[grep("'", x$Name),]

mefa4 documentation built on May 2, 2019, 6:15 p.m.