filtering data.frame based on row_number()

后端 未结 3 939
旧巷少年郎
旧巷少年郎 2021-02-01 14:01

UPDATE: dplyr has been updated since this question was asked and now performs as the OP wanted

I´m trying to get the second to the seventh line in a

3条回答
  •  遇见更好的自我
    2021-02-01 14:29

    Actually dplyr's slice function is made for this kind of subsetting:

    df %>% slice(2:7)
    

    (I'm a little late to the party but thought I'd add this for future readers)

提交回复
热议问题