Skip to content

Reading in csv data with ff package

2 messages · Nick McClure, Jan van der Laan

#
The following seems to work:

data = read.csv.ffdf(x=NULL,file="data.csv",nrows=1001,first.rows = 500,
   next.rows = 1005,sep=",",colClasses = c("integer","factor","logical"))


'character' doesn't work because ff does not support character  
vectors. Character vector need to be stored as factors. The  
disadvantage of that is that the levels are stored in memory, so if  
the number of levels is very large (e.g. with unique strings) you  
might still run into memory problems.

'integer' doesn't work because read.csv.ffdf passes the colClasses on  
to read.table, which then tries to converts your second column to  
integer which it can't.

Jan



Nick McClure <nfmcclure at gmail.com> schreef: