일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 둠칫새
- 외생균근균
- 젖비단그물버섯
- Rstuido
- 생명과학 균학 미생물학 Biology Mycology Microbiology
- 생물정보학
- 탐조
- 파이썬
- 코딩
- 바운새
- R
- mushroom #mushrooms #mushroomhunting #mushroomphotos #mushroomphotography #mycology #mycologist #fungi #fungalecology #fungaldiversity #fantasticfungi #버섯 #탐균 #버섯탐사
- 계묘년
- 곤줄박이
- 갓생
- 대학원생
- 철학
- 토양학
- 에리히 프롬
- 영화 후기
- 영화 해석
- 청도요
- 심리학
- Cannon PowerShot G7 X Mark III
- 영화 리뷰
- 영화
- 토양미생물학
- RStudio
- 더 웨일
- 영화 일기
Archives
- Today
- Total
워라밸 중독자
[R] 데이터프레임에서 필요한 열 추출하기: select 와 pull 본문
> des_df %>% filter(Source == "DB")
# A tibble: 5 × 16
parent node branch.length label isTip x y branch angle Taxon Status Subtree Cluster Source Long taxonomy
<int> <int> <dbl> <chr> <lgl> <dbl> <dbl> <dbl> <dbl> <chr> <chr> <int> <chr> <chr> <chr> <chr>
1 542 29 0.000001 NR_111570_1 TRUE 0.683 163 0.683 119. 7 Non-M… 108 108.7 DB no Fungi;M…
2 546 33 0.00453 NR_111571_1 TRUE 0.675 168 0.673 123. 7 Non-M… 108 108.7 DB no Fungi;M…
3 563 53 0.000001 NR_077209_1 TRUE 0.648 187 0.648 137. 7 Non-M… 108 108.7 DB no Fungi;M…
4 583 90 0.000001 NR_111572_1 TRUE 0.717 137 0.717 100. 6 Intru… 108 108.6 DB no Fungi;M…
5 592 92 0.000001 SH0888026_09FU… TRUE 0.712 129 0.712 94.4 6 Intru… 108 108.6 DB no Fungi;M…
select를 쓰면 데이터프레임 반환하고,
> des_df %>% filter(Source == "DB") %>% select(node)
# A tibble: 5 × 1
node
<int>
1 29
2 33
3 53
4 90
5 92
pull을 쓰면 벡터를 반환한다.
> des_df %>% filter(Source == "DB") %>% pull(node)
[1] 29 33 53 90 92
'코딩, 딱 지금이 시작할때! (코딱지)' 카테고리의 다른 글
[R] R 업데이트 및 패키지 이전 (1) | 2024.06.14 |
---|---|
[R] match 이용해서 데이터프레임 필터링 (2) | 2024.06.03 |
[R] select로 데이터프레임 열(변수) 순서 바꾸기 (0) | 2024.05.27 |
[R] 데이터프레임에서 조건에 맞는 행의 값만 변경하기 (0) | 2024.05.24 |
[R] Pivot wider <-> Pivot longer 자유자재로 와리가리하기 (0) | 2024.05.24 |