[R] Number of words in a string

Hans-Joerg Bibiko bibiko at eva.mpg.de
Wed Apr 9 17:39:58 CEST 2008


On 9 Apr 2008, at 17:29, Markus Gesmann wrote:
> Would this:
>
> sapply(strsplit(C, " "), length)
>
> work for?

or

length(unlist(strsplit(C, " ")))

--Hans



More information about the R-help mailing list