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 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

StackOverflow Point

StackOverflow Point Navigation

  • Web Stories
  • Badges
  • Tags
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Web Stories
  • Badges
  • Tags
Home/ Questions/Q 3161
Alex Hales
  • 0
Alex HalesTeacher
Asked: June 2, 20222022-06-02T04:29:23+00:00 2022-06-02T04:29:23+00:00

r – How can I replace some columns with data from an excel file?

  • 0

[ad_1]

I have a question. Like the title said, now I need to replace some columns with new data from another single excel file. I need to replace them when certain requirements are fulfilled.

For example, I want to replace column R5 to APM (arbitrary column header names, just for example) with new data from another excel file and the following conditions should be met before replacing:

  1. replace with the same ID, which means I want each person’s ID to be matched when replacing
  2. do not replace when a column in a row displays “N”. For example, if any cell between R5 to APM in a row has an N, then do not replace it.

Basically, I want to make sure the data is exactly matched.

How can I complete this task in R? Or, how can I achieve it in MS Excel?
Many thanks in advance for your help! I will be very appreciative of each answer.

Below is an example:
enter image description here

Below is the text version of the screenshot:

ID ID
11 2021/4/15 N 9/11/66 56.9 175 cm Standard Test 22 N/A
11 2021/7/29 Y 9/11/66 55.7 186 cm Standard Test 748 N/A 11 2021/7/29 Y TWCOVID 11 1966/11/9 F Caucasian 157 54 NO NO

In the screenshot below, I want to replace new data with ID 11 to the row that indicates Y and to replace the old data with new data beginning from R5 and ending with APM. I can say for sure that the length of each new data is exactly the same as the length of the old data.

[ad_2]

  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report
Leave an answer

Leave an answer
Cancel reply

Browse

Sidebar

Ask A Question

Related Questions

  • xcode - Can you build dynamic libraries for iOS and ...

    • 0 Answers
  • bash - How to check if a process id (PID) ...

    • 3 Answers
  • database - Oracle: Changing VARCHAR2 column to CLOB

    • 5 Answers
  • What's the difference between HEAD, working tree and index, in ...

    • 4 Answers
  • Amazon EC2 Free tier - how many instances can I ...

    • 0 Answers

Stats

  • Questions : 43k

Subscribe

Login

Forgot Password?

Footer

Follow

© 2022 Stackoverflow Point. All Rights Reserved.

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.