This help topic is for R version 0.60. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/nchar.html
nchar {base}R Documentation

Count the Number of Characters

Description

nchar takes a character vector as an argument and returns a vector whose elements contain the number of characters in the corresponding element of x. It only accepts character vectors as arguments if you want to operate on other objects passing them through deparse first will be required.

Usage

nchar(x)

See Also

strwidth giving width of strings for plotting; paste, substr, strsplit

Examples

x<-c("asfef","qwerty","yuiop[","b","stuff.blah.yech")
nchar(x)
# 5  6  6  1 15

nchar(deparse(mean))
# 23  1 16 45 11 64  2 17 50 43  2 17  1

[Package base version 0.60 ]