I want to split the dataset into 2 in R based upon values in a column
My data is like this(example)
Sn no State
1 22 ALL
2 33 BALL
3 44 FALL
4 55 ALL
5 77 MALL
6 11 FALL
I want to split it into 2 data sets based upon a variable say A=40 which splits the dataset by checking in the 2nd column(one dataset having values greater than 40 the other lesser than 40). The output will be like :-
1 24 ALL
2 35 BALL
6 11 FALL
and
3 44 FALL
4 55 ALL
5 77 MALL