If you write something like indices <- rep(1:(163863/6069), each = 6069)
you can get the i’th block of rows with table[indices == i,] It looks like a little more work than a loop would be since you have to run through all rows for each block, but the implicit loop in this approach is likely to be faster than an explicit for-loop. Cheers Thomas On 25 Apr 2017, 07.01 +0200, Saifuddin, Miah Mohammad <miah.mohammadsaif...@mavs.uta.edu>, wrote: I have a data frame having 163863 values. I want to subset it so that each set has 6069 values in it. for example 1:6069 as first, 6070: 6070+6068 as second. how can I do that, preferably in a loop. TIA [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.