From ripley at stats.ox.ac.uk  Thu Jul  9 21:41:13 2009
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Thu, 9 Jul 2009 20:41:13 +0100 (BST)
Subject: [Rd] save() file size (PR#13816)
In-Reply-To: <20090709172014.5D4B0283031C@mail.pubhealth.ku.dk>
References: <20090709172014.5D4B0283031C@mail.pubhealth.ku.dk>
Message-ID: <alpine.LFD.2.00.0907092036450.3829@gannet.stats.ox.ac.uk>

The evidence contradicts this claim:

> object.size(x)
4666464 bytes
> object.size(y)
5812696 bytes

so 'y' is indeed larger than 'x' (and compresses less well).
Reason: 'x' has automatic row names and 'y' does not.

On Thu, 9 Jul 2009, Mike.Lawrence at dal.ca wrote:

> Full_Name: Mike Lawrence
> Version: 2.9.0
> OS: OS 10.5.7
> Submission from: (NULL) (208.98.203.100)
>
>
> When using save() I notice that sometimes saving smaller objects yield larger
> file sizes.
>
> x=data.frame(
> 	expand.grid(
> 		id=factor(1:1000)
> 		,trial=1:24
> 		,cue=factor(1:3)
> 		,flank=factor(1:4)
> 	)
> )
> save(x,file='temp1.Rdata') #about 20KB
> y=x[x$id!='1',]
> save(y,file='temp2.Rdata') #>500KB
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] save() file size (PR#13816)
Prof Brian Ripley