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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:18:44+00:00 2026-06-15T08:18:44+00:00

So I have many data frames and I’m trying to merge them. Some of

  • 0

So I have many data frames and I’m trying to merge them.
Some of them are in the form:

    sites1  AA1 SA
1   13: C   0.360828
2   14: S   0.017064
3   15: I   0.010810

Others are:

    sites2  AA2 Freq
1   1:  X   0.013
2   1:  S   0.987
3   2:  L   1.000

I have another data frame linking the proper data frame from the first set with the one from the second set and it goes like this:

    V1  V2
1   1JH6    AT4G18930
2   3MXZ    AT2G30410

with the name on the left side corresponding to one data frame and the name on the right side corresponding to another data frame.
I’m trying to merge them by doing

for (i in 1:n){
  name = paste("1",names2[i,2])
  assign(name,merge(names2[i,1],names2[i,2]))
}

but this just returns a data frame with the two names.. Any help?

  • 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-15T08:18:45+00:00Added an answer on June 15, 2026 at 8:18 am

    try replacing the assign statement inside your for loop with the following

         assign(name,merge(get(as.character(names2[i,1])), 
                           get(as.character(names2[i,2]))))
    

    Also, consider fixing the name = paste.... statement as follows:

       name = paste("T1",names2[i,2], sep="")
       # added sep="" to not have a space.
       # changed the name so that does not start with a number
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have many data.frames, for example: df1 = data.frame(names=c('a','b','c','c','d'),data1=c(1,2,3,4,5)) df2 = data.frame(names=c('a','e','e','c','c','d'),data2=c(1,2,3,4,5,6)) df3 =
I have a data frame with an id column and some (potentially many) columns
I have two data frames, Data1 and Data2, that I want to merge based
I have many data frames which are the output of the same kind of
We have some data which represents many model runs under different scenarios. For a
I have many tens of thousands of rows of data that need to be
I have many forms that use AJAX (w/ jQuery) for validation and data submission.
I have many objects reference the same class of stored data. In previous programs,
I have written a Python script for merging many data files in a few
I have a silly question here. I define a class with many data members,

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.