[R] R.matlab memory use

Stefano Ghirlanda dr.ghirlanda at gmail.com
Sun Dec 19 20:35:42 CET 2010

I am trying to load into R a MATLAB format file (actually, as saved by
octave). The file is about 300kB but R complains with a memory
allocation error:

> library(Rcompression)
> library(R.matlab)
Loading required package: R.oo
Loading required package: R.methodsS3
R.methodsS3 v1.2.0 (2010-03-13) successfully loaded. See ?R.methodsS3 for help.
R.oo v1.7.2 (2010-04-13) successfully loaded. See ?R.oo for help.
R.matlab v1.3.1 (2010-04-20) successfully loaded. See ?R.matlab for help.
> f <- readMat("freq.mat")
Error: cannot allocate vector of size 296.5 Mb

On the other hand, if I save the same data in ascii format (from
octave: "save -text"), resulting in a 75MB file, then I can load it
without problems with the read.octave() function from package foreign.
Is this a known issue or am I doing something wrong? My R version is:

> R.version
platform       i686-pc-linux-gnu
arch           i686
os             linux-gnu
system         i686, linux-gnu
major          2
minor          11.1
year           2010
month          05
day            31
svn rev        52157
language       R
version.string R version 2.11.1 (2010-05-31)

Thanks for your help,

Stefano Ghirlanda
www.intercult.su.se/~stefano - drghirlanda.wordpress.com

More information about the R-help mailing list