1

I have a data.frame that has 9 columns and over 16k rows. I need to split the data.frame into 50 groups by one column that is in ascending order (Subj_Avg_Home). The groups should be around equal size.

I searched for an answer in the posts

My data frame looks something like this.

head(thesisdata)
 ID          Home_Score Away_Score Subj_Avg_Home 
48550            4            2       0.0181413635731533           
30965            4            1       0.016167700385985           
40501            5            1       0.0185671994247871           
41771            3            5       0.0186986545666144          
42138            3            4       0.01900475916696            
42975            4            7       0.0202611448135552
43724            1            1       0.0204169805144118
47592            4            3       0.020769733472299
47201            3            4       0.0207922542122643

If I would split this sample into three groups I would like to have three groups like below

 head(group 1)
 ID          Home_Score Away_Score Subj_Avg_Home 
48550            4            2       0.0181413635731533           
30965            4            1       0.016167700385985           
40501            5            1       0.0185671994247871 

head(group 2)         
41771            3            5       0.0186986545666144          
42138            3            4       0.01900475916696            
42975            4            7       0.0202611448135552

head(group 3)
43724            1            1       0.0204169805144118
47592            4            3       0.020769733472299
47201            3            4       0.0207922542122643

I am sorry if my formatting is not optimal!

user3168701
  • 29
  • 1
  • 3

0 Answers0