Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6961799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:34:38+00:00 2026-05-27T15:34:38+00:00

I’ve hit a wall trying to merge a large file and a smaller one.

  • 0

I’ve hit a wall trying to merge a large file and a smaller one. I have read many other posts about memory management in R, and haven’t been able to find a non-extreme (go 64bit, upload to a cluster, etc) method of resolving it. I’ve tried a bit with the bigmemory package, but not been able to find a solution. I thought I’d try here before I throw my hands up in frustration.

The code I’m running is like the below:

#rm(list=ls())
localtempdir<- "F:/Temp/"
memory.limit(size=4095)
[1] 4095
    memory.size(max=TRUE)
[1] 487.56
gc()
         used (Mb) gc trigger  (Mb) max used  (Mb)
Ncells 170485  4.6     350000   9.4   350000   9.4
Vcells 102975  0.8   52633376 401.6 62529185 477.1

client_daily<-read.csv(paste(localtempdir,"client_daily.csv",sep=""),header=TRUE)
object.size(client_daily)
>130MB

sbp_demos<-read.csv(paste(localtempdir,"sbp_demos",sep=""))
object.size(demos)
>0.16MB
client_daily<-merge(client_daily,sbp_demos,by.x="OBID",by.y="OBID",all.x=TRUE)
Error: cannot allocate vector of size 5.0 MB

I guess I’m asking are there any clever ways around this which don’t involve buying new hardware?

  1. I need to be able to merge to create a bigger object.
  2. I’ll then need to be doing regressions etc with that bigger object.

Should I give up? Should bigmemory be able to help solve this?

Any guidance greatly appreciated.

Details: R version 2.13.1 (2011-07-08) Platform: i386-pc-mingw32/i386
(32-bit) Intel 2 Duo Core @2.33GHz, 3.48GB RAM

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:34:39+00:00Added an answer on May 27, 2026 at 3:34 pm

    As Chase already mentioned, you can try data.table or perhaps sqldf.

    For either one, you will likely get more juice out of it if you set the indexes appropriately.

    With data.table you would:

    dt1 <- data.table(sbp_demos, key='OBID')
    dt2 <- data.table(client_daily, key='OBID')
    
    ## Do an INNER JOIN-like operation, where non-matching rows are removed
    mi <- dt1[dt2, nomatch=0]
    
    ## Do a RIGHT JOIN(?)-like operation ... all rows in dt2 will be returned.
    ## If there is no matching row in dt1, the values in the dt1 columns for
    ## the merged row will be NA
    mr <- dt1[dt2]
    

    If you go the sqldf route, look at example 4i on its website … again, make sure you use indexes correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:
I have a reasonable size flat file database of text documents mostly saved in
I have a bunch of posts stored in text files formatted in yaml/textile (from
I am trying to loop through a bunch of documents I have to put
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.