Thanks Chuck, 'rle' was just what I needed.
G
-Original Message-
From: Charles C. Berry [mailto:[EMAIL PROTECTED]
Sent: Saturday, 14 June 2008 02:00
To: Warren, Garth (CSE, Gungahlin)
Cc: r-help@r-project.org
Subject: Re: [R] Looping, Control Flow & Conditional Sta
See
?rle
Start with this:
a1.runs <- rle( a1 )
a1.runs$lengths[ a1.runs$values>0 ]
[1] 3 4
HTH,
Chuck
p.s.
library(fortunes)
fortune(106)
If the answer is parse() you should usually rethink the question.
-- Thomas Lumley
R-help (February 2005)
--
see
?ge
2 matches
Mail list logo