Difference between subset and filter from dplyr

前端 未结 6 1601
Happy的楠姐
Happy的楠姐 2020-12-14 06:03

It seems to me that subset and filter (from dplyr) are having the same result. But my question is: is there at some point a potential difference, for ex. speed, data sizes i

6条回答
  •  执念已碎
    2020-12-14 06:45

    A difference is also that subset does more things than filter you can also select and drop while you have two different functions in dplyr

    subset(df, select=c("varA", "varD"))
    
    dplyr::select(df,varA, varD)
    

提交回复
热议问题