Kate Ignatius
2014-Jun-16 22:21 UTC
[R] Error in merge [negative length vectors are not allowed]
Hi All, I'm trying to merge two files together using: combinedfiles <- merge(comb1,comb2,by=c("Place","Stall","Menu")) comb1 is about 2 million + rows (158MB) and comb2 is about 600K+ rows (52MB). When I try to merge using the above syntax I get the error: Error in merge.data.frame(comb1, comb2, by = c("Place","Stall","Menu")) : negative length vectors are not allowed Is there is something that I'm doing wrong? I've merged larger files together in the past without a problem so am curious what might be the problem here... Thanks in advance! ~K
Prof Brian Ripley
2014-Jun-17 04:45 UTC
[R] Error in merge [negative length vectors are not allowed]
On 16/06/2014 23:21, Kate Ignatius wrote:> Hi All, > > I'm trying to merge two files together using: > > combinedfiles <- merge(comb1,comb2,by=c("Place","Stall","Menu")) > > comb1 is about 2 million + rows (158MB) and comb2 is about 600K+ rows (52MB). > > When I try to merge using the above syntax I get the error: > > Error in merge.data.frame(comb1, comb2, by = c("Place","Stall","Menu")) : > negative length vectors are not allowed > > Is there is something that I'm doing wrong? I've merged larger filesNot telling us the the 'at a minimum' information asked for in the posting guide.> together in the past without a problem so am curious what might be the > problem here... > > Thanks in advance! > > ~KThis is usually an indication that you are trying to create more than 2^31 rows in the result, which looks plausible given your data set sizes. AFAICS merge does not allow long vectors on a 64-bit system in released versions of R. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595