I have a dataframe looks like this:
name strand
thrL 1
thrA 1
thrB 1
yaaA -1
yaaJ -1
talB 1
mog 1
I would like to group first few positive values into a group, negative values a group and next postive numbers as another group which look like this:
name strand directon
thrL 1 1
thrA 1 1
thrB 1 1
yaaA -1 2
yaaJ -1 2
talB 1 3
mog 1 3
I am thinking to use dplyr but I need some help with the code using R. Thank you so much.