Subseting data.frames with more than 1 condition

前端 未结 2 1902
心在旅途
心在旅途 2021-01-27 16:45

I found this question to be similiar to mine, but I need to know a way to do the same thing with mathematical conditions such as less or equal than or greator or equal (<=, >

2条回答
  •  轮回少年
    2021-01-27 17:06

    Just concatenate the expressions with & (AND) or | (OR)

    Using subset

     subset(DF, GENProm < 0.5 & matricula > 10)
    

    Or, more safely, [

    DF[DF[['GENProm']] < 0.5 & DF[['matricula']] > 10, ]
    

提交回复
热议问题