I need to update a large data frame (a) several times a day with a smaller data frame (b). Both data frames share the same number of variables and the same structure of column classes. The only difference is the number of observations and the observations themselves. I've spent hours on this site and others trying to figure out a solution. I finally got merge()
to work for small data frames (313 observations of 96 variables each).
merge(a,b,all=T)
However, when I try to run the same operation on my larger data frame (~1.5 million observations of 96 variables), I get
Error: cannot allocate vector of size 1.6 Gb.
I have ~12 Gb of Free Physical Memory according to Windows Task Manager. I am starting with the gc()
function to make sure I have the most amount of memory possible, but it still won't work. Is there another function that will simply add observations to an existing data frame? I tried a few others, but the result wasn't a data frame with the same structure.
If you can't tell already, I'm new to R (and this forum). I started to learn Stata and someone convinced me to move to R before I got too deep. In Stata, this was an easy operation
clear
use a
append using b
That got the job done without any issues in Stata and it was quick (less than a few seconds).
Can someone please help? Thanks!