Using strapply, we extract all strings of word characters
and apply nchar to each simplifying by taking the max.
library(gsubfn)
strapply(shadstr, "\\w+", nchar, simplify = max)
See the info on the gsubfn home page:
http://gsubfn.googlecode.com
as well as the vignette, help file and demos.
On Fr
On Apr 10, 2009, at 3:40 PM, Shadley Thomas wrote:
Hi Everyone,
I'm new to programming R and have accomplished my goal, but feel
that there
is probably a more efficient way of coding this. I'd appreciate any
guidance that a more advanced programmer can provide.
My goal --
I would like to f
On Fri, Apr 10, 2009 at 2:40 PM, Shadley Thomas
wrote:
[snip]
> My question --
> It seems inefficient to determine which element is the longest and then
> calculate the length of that longest element. I was hoping to find a way to
> simply return the length of the longest word in a more straightf
Hi Everyone,
I'm new to programming R and have accomplished my goal, but feel that there
is probably a more efficient way of coding this. I'd appreciate any
guidance that a more advanced programmer can provide.
My goal --
I would like to find the length of the longest word in a string containing
4 matches
Mail list logo