[R] character count

Ista Zahn izahn at psych.rochester.edu
Fri Dec 12 16:31:10 CET 2008

Dear list,
I have a variable that consists of typed responses. I wish to compute
a variable equal to the number of characters in the original variable.
For example:

> x <- c("convert this to 32 because it has 32 characters", "this one has 22 characters", "12 characters")

[Some magic function here]

> x
[1] 32 22 12

Any ideas?

More information about the R-help mailing list