Re: [R] Converting decimal to binary in R

2013-12-16 Thread Earl F Glynn
水静流深 wrote: i have write a function to convert decimal number into binary number in R. dectobin can get right result ,it is so long ,is there a build-in function to do ? Try the R.utils package: library(R.utils) intToBin(12) [1] 1100 intToBin(255) [1] intToBin(65535) [1]

Re: [R] Converting decimal to binary in R

2013-12-14 Thread Ted Harding
On Fri, Dec 13, 2013 at 10:11 PM, 水静流深 1248283...@qq.com wrote: i have write a function to convert decimal number into binary number in R. dectobin-function(x){ as.numeric(intToBits(x))-x1 paste(x1,collapse=)-x2 as.numeric(gsub(0+$,,x2))-x3 return(as.character(x3))}

[R] Converting decimal to binary in R

2013-12-13 Thread ????????
i have write a function to convert decimal number into binary number in R. dectobin-function(x){ as.numeric(intToBits(x))-x1 paste(x1,collapse=)-x2 as.numeric(gsub(0+$,,x2))-x3 return(as.character(x3))} dectobin can get right result ,it is so long ,is there a build-in function to do ?

Re: [R] Converting decimal to binary in R

2013-12-13 Thread Richard M. Heiberger
I recommend ?sprintf (4^(1/3))^3 != 4 (4^(1/3))^3 == 4 (4^(1/3))^3 - 4 format(c((4^(1/3))^3 , 4), digits=17) sprintf(%+13.13a, c((4^(1/3))^3 , 4)) On Fri, Dec 13, 2013 at 10:11 PM, 水静流深 1248283...@qq.com wrote: i have write a function to convert decimal number into binary number in R.

Re: [R] Converting decimal to binary in R

2013-12-13 Thread Jeff Newmiller
On Sat, 14 Dec 2013, wrote: i have write a function to convert decimal number into binary number in R. dectobin-function(x){ as.numeric(intToBits(x))-x1 paste(x1,collapse=)-x2 as.numeric(gsub(0+$,,x2))-x3 return(as.character(x3))} dectobin can get right result ,it is so long ,is