Finding 'first occurrence' using Match Function in R

前端 未结 2 672
故里飘歌
故里飘歌 2021-01-24 00:00

I am new to \'R\' and \'Stackoverflow\' so forgive me for the incredibly basic question. I\'m trying to find the \'index\' of the first female in my dataset.

Code Snaps

2条回答
  •  终归单人心
    2021-01-24 00:17

    Probably the most direct method would be to use match("F", bike[,"genders"] which will return the index of the first match.

提交回复
热议问题