Skip to content
Back to formatted view

Raw Message

Message-ID: <20030417064512.35898.qmail@web10703.mail.yahoo.com>
Date: 2003-04-17T06:45:12Z
From: Mike Sumner
Subject: bit set or bit test

Hello, does R have functions for setting and testing
bit values?

I want to conserve memory for storing presence/absence
data for large multiple arrays within a single array,
using element values like

present[x,y] <- ntharray[x,y]*(2^n)

where presence is 1, non-presence is 0 and n is the
nth array

e.g.  1*(2^0) + 0*(2^1) + 0*(2^2) + 1*(2^3) + 0(2^4) 

for storing the value 9 for presence in the first and
fourth array, and absence in the second, third and
fifth arrays.  

Does R already have something to handle stuff like
this?

Cheers, Mike.