Re: [R] Filtering using multiple rows in dplyr

2018-05-31 Thread Jeff Newmiller
Yes this can be done using dplyr. One of the main advantages of doing so is that it is possible to develop and modify code to handle fairly complicated requirements easily, but it may not always be best from a performance or memory usage perspective. The example below walks you through some

Re: [R] Filtering using multiple rows in dplyr

2018-05-31 Thread Ulrik Stervbo via R-help
Hi Sumitrajit, dplyr has a function for this - it's called filter. For each group you can count the number of SNR > 3 (you can use sum on true/false). You can filter on the results directly or add a column as you plan. The latter might make your intention more clear. HTH Ulrik On

[R] Filtering using multiple rows in dplyr

2018-05-30 Thread Sumitrajit Dhar
Hi Folks, I have just started using dplyr and could use some help getting unstuck. It could well be that dplyr is not the package to be using, but let me just pose the question and seek your advice. Here is my basic data frame. head(h) subject ageGrp ear hearingGrp sex freq L2 Ldp