On 19/03/2009 4:55 PM, Guillaume Filteau wrote:
Hello all,

I have a 2.0 GB dataset that I can't load into R, due to memory issues. The dataset itself is in a tab-delimited .txt file with 25 variables.

I have a variable I'd like to add to the dataset. How do I do this? Best,

Read a block, add the variable, write the block, and repeat? For example, the reading part is done with

con <- file("somename.txt", "r")
block1 <- read.table(con, nrows=blocksize)

block2 <- read.table(con, nrows=blocksize, head=FALSE, col.names=names(block1))

...

close(con)

The writing part is similar, but depends a lot on the details of what you're doing.

Duncan Murdoch

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to