[R] handling big data set in R

From: shu zhang <szhang.r_at_gmail.com>
Date: Mon, 03 Mar 2008 00:35:01 -0500

Hello R users,

I'm wondering whether it is possible to manage big data set in R? I have a data set with 3 million rows and 3 columns (X,Y,Z), where X is the group id. For each X, I need to run 2 regression on the submatrix. I used the function "split":

datamatrix<-read.csv("datas.csv", header=F, sep=",") dim(datamatrix)
# [1] 2980523 3


subX<-split(X, X)

n<-length(subdata) ### number of groups s1<-s2<-rep(NA, n) ### vector to store the regression slope

for (i in 1:n){
  fit1<-lm(table.y~table.x) ##### find the slope of the histogram of y   s1[i]<-fit$coefficients[2]

  fit2<-lm(subY[[i]]~subZ[[i]]) ####### regress y on z   s2[i]<-fit$coefficients[2]

But my R died before completing the loop... (I've thought about doing it in SAS, but I don't know how to write a loop combined with a PROC REG...) One thing that might be helpful is that my data set has already been sorted based on X. I don't know whether this can be any helpful for managing the dataset.

Any suggestion would be appreciated!


R-help_at_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. Received on Mon 03 Mar 2008 - 05:38:02 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 03 Mar 2008 - 09:30:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive