As I am very new to R Programming, I need your help to find the answer
I have the below data frame as input data, now I want to return the rows which are having the same EntryName but the Sequence is different
EntryName | Entry | GeneNames | Organism | Length | Sequence | Postion |
---|---|---|---|---|---|---|
HXA13_HUMAN | P31271 | HOXA13 HOX | Human | 388 | AAAA | 12 |
SOX21_HUMAN | Q9Y651 | SOX21 SOX25 | Human | 276 | AAAA | 13 |
RBM24_HUMAN | Q9BX46 | RBM24 RNPC6 | Human | 236 | AAAE | 14 |
MZT1_HUMAN | Q08AG7 | MZT1 C13orf | Human | 191 | AAAK | 15 |
HXA13_HUMAN | P51589 | HOXA13 HOXk | Human | 100 | ABAB | 120 |
Now I want to filter the rows for sequence AAAA and it should return the entire row where EntryName is matching with AAAA’s EntryName for other Sequences
I am expecting the below output
EntryName | Entry | GeneNames | Organism | Length | Sequence | Postion |
---|---|---|---|---|---|---|
HXA13_HUMAN | P31271 | HOXA13 HOX | Human | 388 | AAAA | 12 |
HXA13_HUMAN | P51589 | HOXA13 HOXk | Human | 100 | ABAB | 120 |
Along with the R script, MongoDB is also helpful
Thank you so much in advance!
2
Answers
We could do a group by
filter
Or it could be
-output
data
Base R:
We could also use
any
: