This is a follow up to a previous question I Had:
In R:
I would like to somehow determine if the row of a separate data.frame is mostly negative or positive based on row numbers in a column of a different data.frame... I have included my example data frames (data.frame1 and data.frame2) and the desired output. Also is there a way to get the output with the measurements from an ID column included? See example data frames and desired output below
>data.frame1
ID col_a col_b col_c
1 Fish1 1 1 1
2 Fish1 1 -1 -1
3 Fish1 1 1 1
4 Fish1 -1 -1 -1
5 Fish1 1 1 -1
>data.frame2
col_a
1 2
2 3
3 5
Example output/result
ID col_a col_b
1 Fish1 2 -1
2 Fish1 3 1
3 Fish1 5 1