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"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…