Hi to all
I would to determinate whether bits is a binary code and I would to find
out the which bit is set to 1
bits -00110110
I found to detect whether there are only numbers
all.digits(bits)
but is there any function to detect whether there are only 0 and 1 in
the string
And how could I get
Carmen Meier wrote:
Hi to all
I would to determinate whether bits is a binary code and I would to find
out the which bit is set to 1
bits -00110110
I found to detect whether there are only numbers
all.digits(bits)
but is there any function to detect whether there are only 0 and 1 in
the
://socserv.mcmaster.ca/jfox
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Carmen Meier
Sent: Wednesday, November 29, 2006 9:06 AM
To: R-help
Subject: [R] String question
Hi to all
I would to determinate whether bits
On 29 Nov 2006 at 15:06, Carmen Meier wrote:
Date sent: Wed, 29 Nov 2006 15:06:08 +0100
From: Carmen Meier [EMAIL PROTECTED]
To: R-help r-help@stat.math.ethz.ch
Subject:[R] String question
Hi to all
I would to determinate whether
Try:
# TRUE if all 0 and 1
regexpr(^[01]*$, bits) 0
# positions of 1s
gregexpr(1, bits)[[1]]
On 11/29/06, Carmen Meier [EMAIL PROTECTED] wrote:
Hi to all
I would to determinate whether bits is a binary code and I would to find
out the which bit is set to 1
bits -00110110
I found to