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 8269407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:12:58+00:00 2026-06-08T06:12:58+00:00

I am trying to merge two dataframes: one has 908450 observations of 33 variables,

  • 0

I am trying to merge two dataframes: one has 908450 observations of 33 variables, and the other has 908450 observations of 2 variables.

dataframe2 <-merge(dataframe1, dataframe2, by="id")

I’ve cleared all other dataframes from working memory, and reset my memory limit (for a brand new desktop with 24 GB of RAM) using the code:

memory.limit(24576)

But, I’m still getting the error Cannot allocate vector of size 173.Mb.

Any thoughts on how to get around this problem?

  • 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-06-08T06:13:00+00:00Added an answer on June 8, 2026 at 6:13 am

    To follow up on my comments, use data.table. I put together a quick example matching your data to illustrate:

    library(data.table)
    
    dt1 <- data.table(id = 1:908450, matrix(rnorm(908450*32), ncol = 32))
    dt2 <- data.table(id = 1:908450, rnorm(908450))
    #set keys
    setkey(dt1, id)
    setkey(dt2, id)
    #check dims
    > dim(dt1)
    [1] 908450     33
    > dim(dt2)
    [1] 908450      2
    #merge together and check system time:
    > system.time(dt3 <- dt1[dt2])
       user  system elapsed 
       0.43    0.03    0.47 
    

    So it took less than 1/2 second to merge together. I took a before and after screenshot watching my memory. Before the merge, I was using 3.4 gigs of ram. When I merged together, it jumped to 3.7 and leveled off. I think you’ll be hard pressed to find something more memory or time efficient than that.

    Before:
    enter image description here

    After:enter image description here

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

Sidebar

Related Questions

I am trying to merge the data from two tables into one result but
I am trying to merge two examples from the ApiDemos so one overlay over
I'm trying to merge two docx-documents into one docx-document using OpenXML SDK 2.0. The
I am trying to merge two files. One of them is .net3.5 wpf application
I am trying to merge two or more postscript files into one. I tried
I am trying to merge two dataframes with ids, I want to merge first
Hi everyone I'm trying to merge two queries: SELECT DISTINCT name,$price FROM room JOIN
I am trying to merge two similar tables (not exact) to one table. Getting
I am trying to merge two ggplot2 plots into one based on this table:
I'm having tremendous difficulty trying to merge two columns from two tables in PL/SQL.

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.