# A tibble: 11 × 1
`conservation abbreviation`
<chr>
1 EX = Extinct
2 EW = Extinct in the wild
3 CR = Critically Endangered
4 EN = Endangered
5 VU = Vulnerable
6 NT = Near Threatened
7 LC = Least Concern
8 DD = Data deficient
9 NE = Not evaluated
10 PE = Probably extinct (informal)
11 PEW = Probably extinct in the wild (informal)
# A tibble: 11 × 1
uited_col
<chr>
1 EX = Extinct
2 EW = Extinct in the wild
3 CR = Critically Endangered
4 EN = Endangered
5 VU = Vulnerable
6 NT = Near Threatened
7 LC = Least Concern
8 DD = Data deficient
9 NE = Not evaluated
10 PE = Probably extinct (informal)
11 PEW = Probably extinct in the wild (informal)
3.4 数据连接
如果第二个数据集中没有与第一个数据集中相匹配的信息,left_join()函数将会添加NA值。
conserve<-conservation|>separate(`conservation abbreviation`, into =c("abbreviation", "description"), sep =" = ")msleep|>mutate(conservation =toupper(conservation))|>left_join(conserve, by =c("conservation"="abbreviation"))
# A tibble: 83 × 12
name genus vore order conservation sleep_total sleep_rem sleep_cycle awake
<chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
1 Cheet… Acin… carni Carn… LC 12.1 NA NA 11.9
2 Owl m… Aotus omni Prim… <NA> 17 1.8 NA 7
3 Mount… Aplo… herbi Rode… NT 14.4 2.4 NA 9.6
4 Great… Blar… omni Sori… LC 14.9 2.3 0.133 9.1
5 Cow Bos herbi Arti… DOMESTICATED 4 0.7 0.667 20
6 Three… Brad… herbi Pilo… <NA> 14.4 2.2 0.767 9.6
7 North… Call… carni Carn… VU 8.7 1.4 0.383 15.3
8 Vespe… Calo… <NA> Rode… <NA> 7 NA NA 17
9 Dog Canis carni Carn… DOMESTICATED 10.1 2.9 0.333 13.9
10 Roe d… Capr… herbi Arti… LC 3 NA NA 21
# ℹ 73 more rows
# ℹ 3 more variables: brainwt <dbl>, bodywt <dbl>, description <chr>