spliting data by rows

I would like to split a data frame by row i.e. first split until row 300 and the second row split until 400.

I tried to use nrow function but that didn't any other function available to do this?

Do you mean you want to get subsets of a data frame based on row numbers. If so, you can do it like this:

DF300 <- DF[1:300, ]
DF400 <- DF[301:400, ]

If that is not what you mean, please explain what you mean by "split".


Yes. I figured this after posting thanks for this

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.