Wuming,
which(a) will identify the TRUE values and sum(a) will tell you how many
TRUE values there are.
David
-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Wuming Gong
Sent: 29 March 2006 18:21
To: r-help at stat.math.ethz.ch
Subject: [R] Sub-vector
* Please Note : This message was received from the Internet *
_____________________________________________________________
Dear list,
Given a vector of logical values, say
>a <- c(TRUE,TRUE,TRUE,FALSE,FALSE,FALSE,FALSE,TRUE,TRUE,TRUE)
Are there any R functions that can tell whether there are two or more
"TRUE" in a row in this vector?
Thanks,
Wuming
______________________________________________
R-help at stat.math.ethz.ch mailing list
stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
R-project.org/posting-guide.html
__________________________________________________________________
This message might contain confidential information. If it has been sent to you
in error please do not forward it or copy it or act upon its contents, but
report it to postmaster at schroders.com
Schroders has the right lawfully to record, monitor and inspect messages between
its employees and any third party. Your messages shall be subject to such lawful
supervision as Schroders deems to be necessary in order to protect its
information, its interests and its reputation.
Schroders prohibits and takes steps to prevent its information systems from
being used to view, store or forward offensive or discriminatory material. If
this message contains such material please report it to abuse at schroders.com
Schroders does not normally accept or offer business instructions via email
unless prior agreements are in place. Any action that you might take upon this
message might be at your own risk.
Schroder Investment Management Limited
31 Gresham Street
London EC2V 7QA
Authorised and regulated by the Financial Services Authority. Schroder
Investment Management Limited is entered on the FSA register under the following
register number: 119348
Registered Office
31 Gresham Street
London EC2V 7QA
Registered number 1893220
VAT registration number 243 8687 30