I have a data.frame $X$ obtained from a data.frame $Y$ by filtering out some rows. I am now interested in accessing a row with ID $i$ (By ID I mean the value appearing in the very first column, generated by R). I am only aware of the $X[i,]$ command, which, as far as I understand, gives me the $i$-th row in $X$ but not the row with ID $i$.
Is there any other command to access a row by its id?
As an alternative, you can use quotes ""
to refer to a given row by its respective element of rownames()
,e.g.:
X["35",]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With