I am trying to divide a dataframe col into 10 equal no of groups.
I have tried like this way:
Code:
data$test<-as.numeric(cut2(data$age_201512, g=10))
res_count_table_10<-aggregate(data$final_res~data$test,data,sum)
Output is :
I have tried to count the test variable
table(data$test)
How can divide into equal 10 groups?? I have tried the same with Excel VBA using (total no.of rows/10) as number of rows in a group..
I can able to calculate information value in using above group in R. But unable to group with equal no. of rows.
Can any one help me on this? thanks in advance....
I might not be able to clear you..I need a extra column which hold the group number..like I did data$test.