r - filter points in dataframe -


i have dataframe, in group_by, each group have different number of rows. example write group:

my data: x       y 323    50       324    86 325    97  326    315      327    76 328    63 329    15 330    13       331    19 332    75 333    102 334    130 335    111       336    200 337    58 338    83 339    43       

i want filter rows have rows match min(x), max(x), min(y),

mydata%>%filter(x==min(x)|x==max(x)|, y==min(y)) 

but want filter 2 rows indicated ( <- ), @ half between min(x) , min(y), , @ half between min(y) , max(x).

my data: x       y 323    50      <- min(x) 324    86 325    97  326    315     <- or next 1 have point in dataframe 327    76 328    63 329    15 330    13      <- min(y) 331    19 332    75 333    102 334    130 335    111     <-  336    200 337    58 338    83 339    43      <-max(x) 

is there condition include in filter have 5 points?


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -