水静流深 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)
> 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
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
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.
>
>
4 matches
Mail list logo