Got all the answers using ?strsplit... Is there any way without using string 
split?... More specifically... How can I just extract the last word in all the 
strings without using ?strsplit ?

Shubha Karanth | Amba Research
Ph +91 80 3980 8031 | Mob +91 94 4886 4510 
Bangalore * Colombo * London * New York * San José * Singapore * 
www.ambaresearch.com

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hans-Joerg Bibiko
Sent: Wednesday, April 09, 2008 9:10 PM
To: [EMAIL PROTECTED]
Subject: Re: [R] Number of words in a string


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

or

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

--Hans

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
This e-mail may contain confidential and/or privileged i...{{dropped:10}}

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to