From jombart at biomserv.univ-lyon1.fr  Mon Apr  3 12:03:32 2006
From: jombart at biomserv.univ-lyon1.fr (Thibaut Jombart)
Date: Mon, 03 Apr 2006 12:03:32 +0200
Subject: [Rd] pixmaps and R
In-Reply-To: <17447.39695.821834.393844@celebrian.ci.tuwien.ac.at>
References: <4423FE7D.8020907@biomserv.univ-lyon1.fr>	<442738C0.6020800@jhsph.edu>
	<17447.39695.821834.393844@celebrian.ci.tuwien.ac.at>
Message-ID: <4430F2F4.6000709@biomserv.univ-lyon1.fr>

Hello list,

here is a question relative to pixmap pictures in R. Manipulating such 
objects is quite demanding for the RAM, as large matrices are created.

For instance, try to execute the example of rimage library :

### R code ###
library(rimage)
x <- read.jpeg(system.file("data", "cat.jpg", package="rimage"))
plot(x)
object.size(x)
save.image()
### end of R code ###

Moreover, the '.RData' will be approximately the size of 'x' (around 4 
MB), despite the jpeg size is only 16 KB.
Of course it is possible store only the expression reading the pictures 
instead.
For instance:

### R code ###
y=expression(read.jpeg(system.file("data", "cat.jpg", package="rimage")))
object.size(y)
object.size(eval(y))
plot(eval(y))
### end of R code ###

But... does anybody know if compressed pictures could be stored in R? 
And if yes, how ?
 
Thanks,

Thibaut.
-- 
######################################
Thibaut JOMBART
CNRS UMR 5558 - Laboratoire de Biom?trie et Biologie Evolutive
Universite Lyon 1
43 bd du 11 novembre 1918
69622 Villeurbanne Cedex
T?l. : 04.72.43.29.35
Fax : 04.72.43.13.88
jombart at biomserv.univ-lyon1.fr



[Rd] pixmaps and R
Thibaut Jombart