1

I have a data frame like this

 head(data)
              V1      V2  V3 V4    V5  V6    V7     
1 458263182005000000 1941 2 14 -73.90 38.60 US009239
2 451063182005000002 1941 2 14 -74.00 36.90 US009239
3 447463182005000000 1941 2 14 -74.00 35.40 US009239
4 443863182105000000 1941 2 15 -74.00 34.00 US009239
5 436663182105000001 1941 2 15 -74.00 32.60 US009239
6 433063182105000000 1941 2 15 -73.80 31.70 US009239

but when I do

data <- read.table("data.dat",header=F,sep=";")

I get this error

Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  : 
  could not allocate memory (2048 Mb) in C function 'R_AllocStringBuffer'

How can I determine in which row something is going wrong (e.g. the format is different)?

Many thanks

user3036416
  • 1,205
  • 2
  • 15
  • 28
  • 1
    Try passing `colClasses` explicitly or use `fread` from data.table. There is no row where something goes wrong. You are running out of memory. I assume your file is pretty big. – Roland Apr 22 '14 at 18:12

2 Answers2

1

R says can not allocate memory. So you can check how large is the dataset and your computer memory.

Yan Song
  • 112
  • 2
  • 13
0

despite this is an old question... I think R_AllocStringBuffer does not have to do with the overall memory of your computer. Which is also the optionen in this thread:

R could not allocate memory on ff procedure. How come?

Maybe check the delimiter "," or ";". It seems to create a huge string...

kn1g
  • 358
  • 3
  • 16