I'm just beginning to learn R and have some trouble retrieving a row in data frame by name. Below is the console output. Why doesn't df[c("0610007C21Rik"),] give the same output as df[1,] and what should I do retrieve the row by name? Thanks ahead.
> df
# A tibble: 7,236 × 2
gene means
<chr> <dbl>
1 0610007C21Rik 22.2
2 0610007L01Rik 72.1
3 0610007P08Rik 75.2
4 0610007P14Rik 20.3
5 0610009B22Rik 44.4
6 0610009D07Rik 42.8
7 0610009O20Rik 53.7
8 0610010O12Rik 57.6
9 0610011F06Rik 29.4
10 0610030E20Rik 66.0
# … with 7,226 more rows
> df[1,]
# A tibble: 1 × 2
gene means
<chr> <dbl>
1 0610007C21Rik 22.2
> df[c("0610007C21Rik"),]
# A tibble: 1 × 2
gene means
<chr> <dbl>
1 <NA> NA