Reputation: 279
I have a data frame with 491 observations, and I'm trying to subset rows 1 to 123 and rows 259 to 367. Is there an operator I can use to indicate that?
Upvotes: 1
Views: 94
Reputation: 886938
We can use row indexing by concatenating the sequence of values from 1 to 123 and 259 to 367
df2 <- df1[c(1:123, 259:367),]
Upvotes: 1