[19355] in s-news-athena

home help back first fref pref prev next nref lref last post

[S] Storage space hint

daemon@ATHENA.MIT.EDU (Michael Camilleri)
Wed Sep 29 17:27:29 1999

Message-Id: <0D94E49D52E0D01181840000F8040B9769EFF8@www.branz.org.nz>
From: Michael Camilleri <branzmtc@branz.org.nz>
To: "'s-news@wubios.wustl.edu'" <s-news@wubios.wustl.edu>
Date: Thu, 30 Sep 1999 09:20:34 +1200
Mime-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"


For those that don't know already, you can half the storage space for a
numeric object by specifying single precision.  There are at least 3 ways to
do this:

1) For a vector:
storage.mode(x) <- "single"

2) For a matrix or data frame
data <- convert.col.type(target = data, column.spec = 1:ncol(data), 
		column.type = "single")
This function appears to be undocumented

or for(i in 1:ncol(data)) storage.mode(data[,i]) <- "single"

3)Use the Data|Change Data Type menu (which calls (2))

Well worth doing if you have large data sets and don't need double precision
accuracy. It does not appear to affect any Splus analyses.

use the object.size(x) function to find out how many bytes your object uses.

Cheers!
Michael Camilleri
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

home help back first fref pref prev next nref lref last post