Quick question about subsetting via character-class

后端 未结 3 1566
情话喂你
情话喂你 2021-01-28 15:58

I think this is a super quick thing, but I figured I\'d ask since I can\'t for the life of me remember how to do it...

Suppose, I have a data.frame (call it, DF

3条回答
  •  Happy的楠姐
    2021-01-28 16:43

    Is this what you want?

    DF[ ,foo][1]

    Ah, Joshua posted while I was typing... You can aslo select regions of the columns, eg:

    DF[1:3,foo][1]
    

提交回复
热议问题