subset data frame based on percentage

前端 未结 2 1301
半阙折子戏
半阙折子戏 2020-12-30 13:35

i have a data frame that contains a data like this :

V1 V2 V3
1  2  0.34
1  3  0.31
1  4  0.12
1  5  0.12

the data frame is bigger but that

相关标签:
2条回答
  • 2020-12-30 14:14

    The subset() function is handy because (among other benefits) it allows you to avoid having to repeatedly mention the name of the data-frame:

    subset(dataFrame, V3 <= quantile(V3, 0.2))
    
    0 讨论(0)
  • 2020-12-30 14:20
    ss <- subset(dataFrame, subset=(dataFrame$V3 <= quantile(dataFrame$V3, 0.20)))
    
    0 讨论(0)
提交回复
热议问题