I have a small r code snippet that takes searches a value in a row and then returns the values in the whole column. Now I need this modified by including another function that does the following.
The script should do the same as it does now with only one difference:
In one row for example b it should find the value in the row but then not return the whole column. It should take the next higher one and return the Sum of the value of all the ones in that row.
I have attached a picture which would illustrate that process