[R] data.frame size limit

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jun 9 08:25:11 CEST 2004


On Tue, 8 Jun 2004, Philip Sobolik wrote:

> Is there a limit to the number of columns that a data.frame can have? 

Yes.  A data frame is a list, and a list is limited to 2^31-1 items.

>  For 
> example, can I read.csv() a file that has 1000 columns and 10,000 rows, 
> will it break or is it limited by available memory.

It will not `break', but it may fail with an error message, depending how 
much the `available memory' is.  R will run in 16Mb RAM but this problem 
will not.

Both ?read.table and the R Data Import/Export Manual give hints on how to 
read large tables efficiently, and it may well be necessary to follow 
them.


-- 
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




More information about the R-help mailing list