Learn R Programming

mefa4 (version 0.3-2)

nameAlnum: Utility functions, mostly for character manipulation

Description

Utility functions, mostly for character manipulation.

Usage

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 expla

Value

  • Character vector.

See Also

paste, paste0, strsplit, gsub

Examples

Run this code
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),]

Run the code above in your browser using DataLab