Implementation of skyline query or efficient frontier

前端 未结 6 1785
慢半拍i
慢半拍i 2020-12-06 02:44

I know there must be an easy answer to this but somehow I can\'t seem to find it...

I have a data frame with 2 numeric columns. I would like to remove from it, the r

6条回答
  •  庸人自扰
    2020-12-06 02:57

    Here is an sqldf solution where DF is the data frame of data:

    library(sqldf)
    sqldf("select * from DF a
     where not exists (
       select * from DF b
       where b.Col1 >= a.Col1 and b.Col2 >  a.Col2  
          or b.Col1 >  a.Col1 and b.Col2 >= a.Col2
     )"
    )
    

提交回复
热议问题