Hello all,
I was under the (false?) assumption that an object that is class
logical, would take up less memory than an object with class integer.
Below am I correctly showing this is not the case?

This was an attempt to reduce memory usage.  I'm dealing with two large
arrays (could be integers).  Their contents are the exact same, but one
has NA's in random locations.  I thought instead of having the second
array as an integer, it could be logical and the TRUE vs FALSE could be
used to update data in the first array.  (but even this idea may be weak
if I just end up with a third temporary array...)

I'm running win xp sp3, "R version 2.14.1 (2011-12-22)".
Thanks very much.
Michael

______________________
arr<-array(1:60,c(3,4,5))
arr2<-array(TRUE,c(3,4,5))

mode(arr)
class(arr)
storage.mode(arr)

mode(arr2)
class(arr2)
storage.mode(arr2)

object.size(arr)
object.size(arr2)

______________________________________
Michael Folkes
Salmon Stock Assessment
Canadian Dept. of Fisheries & Oceans     
Pacific Biological Station
3190 Hammond Bay Rd.
Nanaimo, B.C., Canada
V9T-6N7
Ph (250) 756-7264 Fax (250) 756-7053  michael.fol...@pac.dfo-mpo.gc.ca



        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to