-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathname_test.R
31 lines (22 loc) · 950 Bytes
/
name_test.R
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
#├ FAO data - ISSCAAP codes and Scientific names ----
#reading excel
readxl::excel_sheets(here::here("data",
"ASFIS-production_FAO-NFISS.xlsx"))
#loading the data
isscaap <- readxl::read_excel(here::here("data",
"ASFIS-production_FAO-NFISS.xlsx"),
sheet = 1) %>%
rename(alpha_code = "3A_CODE") #rename bc R doesn't like variable names
#starting w/ a number
names(isscaap)
names(isscaap)[4] <- "scientific_name"
#1795
name_test <- fao_fish_fct %>% filter(!is.na(scientific_name)) %>%
select(fdc_id,food_desc, scientific_name, source_fct) %>%
left_join(., isscaap %>% select(1:5)) %>%
relocate(any_of(c("scientific_name", "Ref", "ISSCAAP")),
.after = food_desc)
name_test %>%
filter(!is.na(ISSCAAP)) %>% count()
name_test %>% filter(!is.na(scientific_name), is.na(ISSCAAP)) %>%
distinct(scientific_name)