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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:08:11+00:00 2026-05-27T22:08:11+00:00

I have a problem…. I have two data frames >anna1 name from to result

  • 0

I have a problem….

I have two data frames

>anna1
     name   from       to        result
     11     66607     66841       0
     11     66846     67048       0
     11     67053     67404       0
     11     67409     68216       0
     11     68221     68786       0
     11     68791     69020       0
     11     69025     69289       0
     11     69294     70167       0
     11     70172     70560       0

and the second data frame is

>anna2
     name   from      to       result
     11     66607     66841       5
     11     66846     67048       6 
     11     67409     68216       7
     11     69025     69289       12
     11     70172     70560       45

What I want is to create a new data frame similar with the anna1 where all the 0 values will be replaced by the correct results in the correct row from the anna2

you are going to notice that in the anna2 data frame, in the from and to columns have only some same values with the respective in the anna1 data frame
….the intermediate are missing

So i need somehow to take the numbers from the result column in the anna2 and put them in the correct row in the anna1

thank you in advance

Best regards
Anna

  • 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-27T22:08:12+00:00Added an answer on May 27, 2026 at 10:08 pm

    If the “from” column is guaranteed to be unique in both anna1 and anna2, AND every row in anna2 has a matching row in anna1 (though not vice versa), a simple solution is

    row.index = function(d) which(anna1$from == d)[1]
    indices = sapply(anna2$from, row.index)
    anna1$result[indices] = anna2$result
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have problem while getting data from Memcached on .NET MVC solution. I have this
I have problem with $_POST data. Some fields are missing from input form when
I have problem with this code..I want to extract data from flat file and
I have problem when I try insert some data to Informix TEXT column via
I have problem creating new instance of excel 2007 using VBA (from Access 2002).
I have problem while sending messages from android to PC. Messages are send when
I have problem with encoding data in Oracle database. I want to xor string
I have problem when creating a file in encoding 'utf-8' and reading it from
I have problem with sending a object from my webservice. I have created a
I have problem with following query: SELECT g_contac.contid, g_contac.name, g_contac.email, f_sync.foreign_key, ( SELECT COUNT(g_cpers.cpersid)

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.