R_Shift - RとLinuxと...

RとLinuxと...


R_Shift

Rの備忘録

尋ねられたので.つまりC風の以下の操作をRで行う

unsigned char c = 0XA;  
printf( "c = %#04x ( c =  %3d\n", c << 1);  // c = 0x14 ( c =  20)  
 printf( "c = %#04x ( c =  %3d\n", c << 2); // c = 0x28 ( c =  40) 
 printf( "c = %#04x ( c =  %3d\n", c << 3); //  c = 0x50 ( c =  80)  
> 0xAp1
[1] 20
> 0xAp2
[1] 40
> 0xAp3
[1] 80
> help(NumericConstants)
 
Link: Rの備忘録(1824d)
Last-modified: 2011-07-02 (土) 16:27:13 (2724d)