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

  • Home
  • SEARCH
  • 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 8516857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:32:42+00:00 2026-06-11T05:32:42+00:00

I have the following like data in a tab-delimted text file named original Name

  • 0

I have the following like data in a tab-delimted text file named original

Name     Symbol       Value
abcd       A            56   
de45       C            67
ji98       H            90
k9ug       K            43
phzt       L            98
prex       P            21
kadf       T            32

Also I have list of selected Symbols stored in another tab delimited text file named duplicate

Symbol     Description
 K            Intel
 P            Diary
 C            Cape
 S            Sheath
 A            Aim

I want to extract the rows from original file which has same Symbol with duplicate. I want my output like the following:

Name     Symbol       Value
abcd       A            56   
de45       C            67
k9ug       K            43
prex       P            21

I tried using the following code but some how I could not get any results or only the row of A. Here is the code which I have used

result <- original[original$Symbol %in% duplicate$Symbol,]

Could anyone please help me.

  • 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-11T05:32:43+00:00Added an answer on June 11, 2026 at 5:32 am

    This can be done with a simple merge:

    merge(original, duplicate, by.x="Symbol", by.y="symbol")
    #   Symbol Name Value Description
    # 1      A abcd    56         Aim
    # 2      C de45    67        Cape
    # 3      K k9ug    43       Intel
    # 4      P prex    21       Diary
    

    You can manually drop the Description column before or after merging if it is not relevant.

    Also, I don’t know if this is a problem with the question as posted or if it is a problem with your code, but:

    original[original$Symbol %in% duplicate$symbol, ]
    #   Name Symbol Value
    # 1 abcd      A    56
    # 2 de45      C    67
    # 4 k9ug      K    43
    # 6 prex      P    21
    

    Of course, you have to spell original correctly, which you did not!

    Assumptions

    1. The correct capitalization of the word “symbol” in names(original) shows up with an upper-case S (Symbol).
    2. The correct capitalization of the word “symbol” in names(duplicate) shows up with a lower-case s (symbol).

    If both are capitalized, then you can use either of the following solutions:

    merge(original, duplicate)
    original[original$Symbol %in% duplicate$Symbol, ]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some html like the following: <div class=control-group> <input type=text data-bind=value: $data.DealCode name=DealCode
I have a data file that looks like the following example. I've added '%'
I have data like the following: var data = [{ id: 1, date: new
I have some data formated like the following 2009.07.02 02:20:14 40.3727 28.2330 6.4 2.6
I have something like the following data structure: Category StartDateTime EndDateTime =============================================== 1 12/1/2009
I have a JavaScript data structure like the following in my Node.js/Express web app:
I have the following data test<-data.frame(group=1:10, var.a=rnorm(n=10,mean=500,sd=20), var.b=runif(10)) I would like a barplot with
I have some data in a table that looks roughly like the following: table
I have a data source with about 2000 lines that look like the following:
I have a jQuery post call like the following: $.post('/Controller/_PartialAction', { 'param1': data },

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.