I am trying to do something quite odd. 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
>data.frame1
col_a col_b col_c
1 1 1 1
2 1 -1 -1
3 1 1 1
4 -1 -1 -1
5 1 1 -1
>data.frame2
col_a
1 2
2 3
3 5
Example output/result
col_a col_b
1 2 negative
2 3 positive
3 5 positive
Another example output could be
Example 2 output/result
col_a col_b
1 2 -1
2 3 1
3 5 1
Thank you for all the answers. Follow up to the first question: 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



