Re: [R] dec2bin?

2005-10-01 Thread Prof Brian Ripley
On Sat, 1 Oct 2005, Haiyong Xu wrote: > I just want to ask if there is any function that can convert decimal > number to binary vector. What do you mean by a binary vector? Function intToBits might be what you are looking for, e.g. > x <- as.integer(1234) > y <- intToBits(x) > options(width=50

Re: [R] dec2bin?

2005-10-03 Thread Tuszynski, Jaroslaw W.
It is unclear what you are trying to do, but check bin2raw in caTools package: > print(x <- (1:5)*pi) [1] 3.141593 6.283185 9.424778 12.566371 [5] 15.707963 > print(y <- bin2raw(x)) [1] 18 2d 44 54 fb 21 09 40 18 2d 44 54 fb 21 19 [16] 40 d2 21 33 7f 7c d9 22 40 18 2d 44 54 fb 2

Re: [R] dec2bin?

2005-10-03 Thread Prof Brian Ripley
On Mon, 3 Oct 2005, Tuszynski, Jaroslaw W. wrote: > It is unclear what you are trying to do, but check bin2raw in caTools > package: > >> print(x <- (1:5)*pi) > [1] 3.141593 6.283185 9.424778 12.566371 > [5] 15.707963 >> print(y <- bin2raw(x)) > [1] 18 2d 44 54 fb 21 09 40 18 2d 44 54

Re: [R] dec2bin?

2005-10-03 Thread Tuszynski, Jaroslaw W.
ional Corporation <\__,| (703) 676-4192 "> \ [EMAIL PROTECTED] ` \ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, October 03, 2005 11:49 AM To: Tuszynski, Jaroslaw W. Cc: Haiyong Xu