Change values in table based on another table
Hello everyone! I have two tables
The first one

structure(list(name = c("B", "A", "C", "E",
"F", "D"), bio = c(5, 5, 5, 4, 4, 5), fl = c(4, 4,
4, 4, 4, 4), phyl = c(3, 4, 4, 3, 4, 4), addit = c(1, 1, 0, 1,
0, 0), sum = c(15, 14, 14, 14, 13, 12)), row.names = c(NA, -6L
), class = c("tbl_df", "tbl", "data.frame"))
And the second one

structure(list(name = c("A", "B", "C", "D",
"E", "F"), pass = c(0, 0, 0, 0, 0, 0), not_pass = c(0,
0, 0, 0, 0, 0)), row.names = c(NA, -6L), class = c("tbl_df",
"tbl", "data.frame"))
I trying to get the table like this

As a result I need to do +1 in pass column for names in top four rows from the first table and +1 in not_pass column for names in other rows from the first table and I have absolutely no idea how to do this.
• 131 views
•
link
0 answers
No answers yet.
Log in to answer this question.
what is the basis of 1 or 0 in final frame? I don't think you need second frame. From the first frame, final frame can be constructed if criteria for pass or fail known.