First letter to upper case

You can try something like:

name<-"hallo"
paste(toupper(substr(name, 1, 1)), substr(name, 2, nchar(name)), sep="")

Or another way is to have a function like:

firstup <- function(x) {
  substr(x, 1, 1) <- toupper(substr(x, 1, 1))
  x
}

Examples:

firstup("abcd")
## [1] Abcd

firstup(c("hello", "world"))
## [1] "Hello" "World"

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)