I am looking for a help to get consecutive positive and negative numbers on these lines.
columns : M-1 to M-6
In first row,you can see there are 2 consecutive +ve's and corresponding result needs to be calculated in Consecutive +ve column and vice versa. I tried using dpylr, but i was not able to formulate for all these rows(which is a part of a much bigger data set), many of the queries which got answered in respective forums were actioning only 1 column i.e checking results for "M-6" column alone. Please help me out.
Can this be done with the help of a for and if else loop as well?