Skip to content
Prev 301164 / 398503 Next

ERROR : cannot allocate vector of size (in MB & GB)

Thank you Jim. Its working fine !. 
Thanks a lot.

- Antony.

-----Original Message-----
From: jim holtman [mailto:jholtman at gmail.com] 
Sent: Tuesday, July 24, 2012 11:30 PM
To: Akkara, Antony (GE Energy, Non-GE)
Cc: r-help at r-project.org
Subject: Re: [R] ERROR : cannot allocate vector of size (in MB & GB)

try this:

input <- file("yourLargeCSV", "r")
fileNo <- 1
repeat{
    myLines <- readLines(input, n=100000) # 100K lines / file
    if (length(myLines) == 0) break
    writeLines(myLines, sprintf("output%03d.csv", fileNo))
    fileNo <- fileNo + 1
}
close(input)
On Tue, Jul 24, 2012 at 9:45 AM, Rantony <antony.akkara at ge.com> wrote:
function(DataMatrix,Destination,NoOfLineToGroup)
each=NoOfLineToGroup)
--
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.