Error: cannot allocate a vector of 39.00GB

Here is a nice answer on a related topic about dealing with large datasets on R

To summarise you have another options as using more RAM efficient libraries like data.table or change your approach to out of memory solutions like sql databases.

1 Like