You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
574 B
R

##################################################
################## capitalize ####################
##################################################
capitalize <- function(x) {
## Description:
## Capitalizes the first letter of a string
## == This function was inspired by the function supplied in the base R doc for chartr()
## Usage:
## capitalize(string)
## Arguments:
## x: a string or vector of strings
## Value:
## A string or vector of strings
#
paste(toupper(substring(x, 1, 1)), substring(x, 2),
sep = "")
}