How to get row from R data.frame

后端 未结 5 608
温柔的废话
温柔的废话 2020-12-23 16:02

I have a data.frame with column headers.

How can I get a specific row from the data.frame as a list (with the column headers as keys for the list)?

Specific

5条回答
  •  情深已故
    2020-12-23 16:27

    Logical indexing is very R-ish. Try:

     x[ x$A ==5 & x$B==4.25 & x$C==4.5 , ] 
    

    Or:

    subset( x, A ==5 & B==4.25 & C==4.5 )
    

提交回复
热议问题