Extract data from large data frames based on column values


I have a table (Table1) with column of IDs and other values linked to each ID (rows). I need to create a new column in a second table "condition" according to the values found in the Table1 with exact same IDs. Table1 and Table2 have few common IDs and I need to identify which are already in Table1.

Example Table1:
ID       Condition
2345     old
2346     old
2347     new

Table 2:
ID          Condition based on table1 - *What I need to add!*
2345     old
2347     new
2348     not-found

I am a beginner. The idea is to solve using only R (no python libraries or commands). Thank you so much.

Please post a reproducible example for the forum users to help you (Refer to reprex criteria).

Check how you can go through at;

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.