forked from micronutrientsupport/fct
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtz_matches.R
212 lines (154 loc) · 7.2 KB
/
tz_matches.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
source("kenfct.R")
source("wafct.R")
#Codes to be added
paste0("22270.0", seq(1, 4, by = 1))
subset(dictionary.df,
str_detect(FoodName_3, "biscuit")
#&
#str_detect(FoodName_2, "milk")
)
subset(dictionary.df,
str_detect(scientific_name, "scomberomorus"))
subset(dictionary.df, ID_2 == "23162")
subset(dictionary.df, ID_3 == "1529.02")
subset(dictionary.df, ID_1 == "2625")
distinct(subset(dictionary.df, ID_1 == "2625", select = c(ID_2, FoodName_2)))
distinct(subset(dictionary.df, ID_0 == "CE", select = c(ID_1, FoodName_1)))
subset(dictionary.df, ID_2 == "F1061" &
FoodName_2 == "meat of chickens, fresh or chilled")
code <- c( "1553",
"1542",
"1540",
"15291",
"15290",
"1529",
"15271",
"15270",
"1527",
"1514",
"15030",
"1503")
food <- "drop"
id1 <- "1505"
id2 <- "1290.9"
subset(dictionary.df, str_detect(FoodName_2, "juice"))
subset(dictionary.df, str_detect(FoodName_3, "bread"))
subset(kenfct, str_detect(fooditem, "Ice")) %>% pull(code)
subset(kenfct, str_detect(code, "5035"))
subset(kenfct, str_detect(ID_3, "23120.03.02"))
subset(wafct, str_detect(code, "12_012"))
subset(dictionary.df, ID_2 %in% id2)
subset(dictionary.df, ID_2 %in% code, select = c(FoodName_2, ID_2))
subset(dictionary.df, ID_2 == "2351F",
select = "FoodName_2")
#### Vegetables others -------
vege <- subset(kenfct, foodgroup == "VEGETABLE AND VEGETABLE PROCUCTS")
#### Brown sugar -------
#### Capsicum -------
#### Leaves -------
subset(kenfct, str_detect(fooditem, "cow pea") & str_detect(fooditem, "raw"),
select = c(code, fooditem, ID_3, foodgroup, scientific_name))
subset(dictionary.df, str_detect(FoodName_3, "lea"),
select = c(FoodName_3, ID_3, FoodName_2))
#### Fish -------
###### wafct -------
subset(wafct, str_detect(fooditem, "Fish") & str_detect(fooditem, "dried"),
select = c(code, fooditem, ID_3, foodgroup, scientific_name))
subset(wafct, str_detect(foodgroup, "Fish")
#& is.na(scientific_name)
,
select = fooditem) %>% distinct() %>% pull()
subset(wafct, str_detect(foodgroup, "Fish") & str_detect(fooditem, " raw"),
select = c(code, fooditem, ID_3, foodgroup, scientific_name))
fish_code <- c("Labeo spp.",
"Engraulis encrasicolus",
"Bagrus spp.",
"Synodontis spp.",
"Clarias gariepinus",
"Lates niloticus" ,
"Oreochromis spp./Tilappia spp.",
"Sphyraena spp.",
"Scomberomorus spp.",
"Sardinella spp.",
"Family: Penaeidae" ,
"Thunnus spp.")
subset(wafct,
scientific_name %in% fish_code, select = code) %>% pull()
#FRESH WATER
"Labeo spp.", catfish, lake Tanganyika & sardine?, Lake Nyasa
"Engraulis encrasicolus", Engraulicypris sp., sardine, (Usipa/dagaa), Lake Nyasa
"Bagrus spp.", Bagrus docmak/Bagrus , Catfish (Mbofu, Kibogobogo)/ Sardine (Mbofu)/ Sardine (Vitoga?), Lake Tanganyika/ Lake Nyasa /Mtera dam
"Synodontis spp.", Synodontis lacustricolus/ Synodontis, Catfish (Ngogo/Gogogo/Kolokolo)/ Sardine (Ngogo)/ Sardine (Kambale), Lake Tanganyika/Lake Nyasa /Mtera dam
"Clarias gariepinus", Clarias gariepinus/ Clarias theodorae/ Clarias liocephalus/Clarias gariepinus/ Clarias sp. , Catfish (Kambale,Mumi)/ Catfish (Kambale) (x3)/ Sardine (Ngogo), Lake Tanganyika/ Lake Victoria (x3)/ Mtera dam
"Lates niloticus" , Lates stappersii (Mgebuka/Mkeke/Mvolo)/ Lates anguistifrons (Sangara)/ Lates mariae (Sangara /Ng’omba)/ Lates microlepis (Sangara/Nonzi)/ Lates niloticus, Nile perch (x4)/ Nile perch (Sangara), Lake Tanganyika (x4)/ Lake Victoria
"Oreochromis spp./Tilappia spp.", Oreochromis tanganicae (Serotheron) (Ngege)/ Oreochromis niloticus (Sato/Perege)/ Oreochromis rukwaensis (Sasala)/ Oreochromis leucostictus (Satu, Ngege)/ Tilapi zillii (Sato)/Tilapia rendalli (Kayabo)/ Oreochromis sp. (Magege)/ Oreochromis urolepis (Perege) , Tilapia , Lake Tanganyika /Lake Victoria (x5)/Lake Nyasa/ Mtera dam
#MARINE
"Sphyraena spp.", Sphyrae na obtusata/ Sphyraenella chrysotaenia , NA/ Obtuse barracuda (Msusa/Mzia)
"Scomberomorus spp.", Scomberomorus plurilineatus, King fish (Nguru)
"Sardinella spp.", Sardinella neglecta, East African sardinella (Dagaa-papa)
"Family: Penaeidae" , Penaeus bubulus, Giant tiger prawn (Kamba mti)
"Thunnus spp.", Thunnus obesus (Jodari macho makubwa) (tuna-like)
#NO REPORTED
"Gadus morhua"
"Trachurus trachurus"
"Cyprinus carpio"
"Callinectes spp."
"Trachurus symmetricus"
"Coryphaena hippurus"
"Amblypharyngodon mola"
"Mormyrus spp."
"Family: Buccinidae"
"Polydactylus spp."
"Families: Palaemonidae/Penaeidae"
"Family: Palaemonidae"
"Family: Veneridae"
"Epinephelus spp."
###### kenfct -------
#8008, Nile perch, dry, raw
subset(kenfct, str_detect(fooditem, "Fish|fish")
& str_detect(fooditem, "dr")
,
select = c(code, fooditem, ID_3, scientific_name))
subset(kenfct, str_detect(foodgroup, "FISH")
#& is.na(scientific_name)
,
select = fooditem) %>% distinct() %>% pull()
subset(kenfct, str_detect(foodgroup, "FISH") & str_detect(fooditem, " raw") ,
select = c(code, fooditem, ID_3, foodgroup, scientific_name))
subset(kenfct,
scientific_name %in% c("Rastrineobola argentea",
"Protopterus annectens",
"Clarias gariepinus",
"Lates niloticus" ,
"Oreochromis niloticus",
"Rastrelliger kanagurta",
"Carcharhinus spp.",
"Penaeidae" ,
"Sardinella spp.",
"Thunnus albacares/T. thynnus"), select = code)
#FRESH WATER
"Rastrineobola argentea", Rastrineobola argentae, Lake Victoria sardine (Dagaa), Lake Victoria
"Protopterus annectens", Protopterus aethiopicus, Protopterus (Kamongo, Kambale mamba), Lake Victoria
#These three are reported in wafct too
"Clarias gariepinus", Clarias gariepinus/ Clarias theodorae/ Clarias liocephalus/Clarias gariepinus/ Clarias sp. , Catfish (Kambale,Mumi)/ Catfish (Kambale) (x3)/ Sardine (Ngogo), Lake Tanganyika/ Lake Victoria (x3)/ Mtera dam
"Lates niloticus" , Lates stappersii (Mgebuka/Mkeke/Mvolo)/ Lates anguistifrons (Sangara)/ Lates mariae (Sangara /Ng’omba)/ Lates microlepis (Sangara/Nonzi)/ Lates niloticus, Nile perch (x4)/ Nile perch (Sangara), Lake Tanganyika (x4)/ Lake Victoria
"Oreochromis niloticus", Oreochromis tanganicae (Serotheron) (Ngege)/ Oreochromis niloticus (Sato/Perege)/ Oreochromis rukwaensis (Sasala)/ Oreochromis leucostictus (Satu, Ngege)/ Oreochromis sp. (Magege)/ Oreochromis urolepis (Perege) , Tilapia , Lake Tanganyika /Lake Victoria (x3)/Lake Nyasa/ Mtera dam
#MARINE
"Rastrelliger kanagurta", Rastrelliger kanagurta/ Restrelliger chrysozonus, NA (Vibua)/ Indian Mackerel(Vibua)
"Carcharhinus spp.", Carcharhinus falciformis, Silky shark (Dagaa-Papa)
#These three are reported in wafct too
"Penaeidae" , Penaeus bubulus, Giant tiger prawn (Kamba mti)
"Sardinella spp.", Sardinella neglecta, East African sardinella (Dagaa-papa)
"Thunnus albacares/T. thynnus", Thunnus obesus (Jodari macho makubwa) (tuna-like)
#NO REPORTED
"Gadus spp."
"Anguilla spp."
"Ilisha melastoma"
#### Beef -------
x <- kenfct$FAT[kenfct$code %in% c("7001", "7002", "7004")]
#x[4:6] <- wafct$FAT[wafct$code %in% c("07_014", "07_009", "07_002")]
y <- wafct$FAT[wafct$code %in% c("07_014", "07_009", "07_002")]
mean(y)
wafct$ref[wafct$code %in% c("07_014", "07_009", "07_002")]
kenfct$biblio_id[kenfct$code %in% c("7001", "7002", "7004")]
kenfct$EDIBLE[kenfct$code %in% c("7001", "7002", "7004")]