Hello,
I have a data.frame
of genes like this:
GENE1 ACTIVATION
GENE1 INHIBITION
GENE1 ACTIVATION
GENE1 ACTIVATION
GENE2 UNKNOWN
GENE2 INHIBITION
GENE2 UNKNOWN
GENE3 ACTIVATION
GENE3 UNKNOWN
GENE3 ACTIVATION
and I would like to keep the table in the following format
GENE1 ACTIVATION
GENE1 INHIBITION
GENE2 UNKNOWN
GENE2 INHIBITION
GENE3 ACTIVATION
GENE3 UNKNOWN
I tried with the following code:
genes <- genes[!duplicated(genes[1]),]
but like that, I just get the "unique" genes of the column one, for example
GENE1 ACTIVATION
GENE2 INHIBITION
GENE3 UNKNOWN
Any suggestions? Thanks in advance.
Thanks for your help! I just tried with
genes[!duplicated(genes[, 1:2]), ]
and it works perfectly! Thank you so much!![edit] I see that you edited because you solved it, you are welcome :)