Skip to content

Commit

Permalink
testing new gapfilling fao data cleaning issue NP
Browse files Browse the repository at this point in the history
  • Loading branch information
annaramji committed Aug 27, 2024
1 parent 93429b5 commit d0b4d5f
Show file tree
Hide file tree
Showing 7 changed files with 336 additions and 297 deletions.
2 changes: 1 addition & 1 deletion globalprep/np/v2024/STEP1a_np_ornamentals_prep.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ files_old <- list.files(dir_fao_data_old, pattern = glob2rx('*.csv'), full.names
# ===== loop ================
for (f in files) {
# f <- files[1] # un-comment and update to test individual files
f <- files[2] # un-comment and update to test individual files # 1 = quant, 2 = usd
cat(sprintf('\n\n\n====\nfile: %s\n', basename(f)))
#d <- read.csv(f, check.names = FALSE, strip.white = TRUE, stringsAsFactors = FALSE) # stringsAsFactors=T
Expand Down
6 changes: 3 additions & 3 deletions globalprep/np/v2024/STEP1c_np_fishfeed_prep.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />


<meta name="author" content="Compiled on Mon Aug 19 17:18:37 2024 by ramji" />
<meta name="author" content="Compiled on Tue Aug 27 16:14:14 2024 by ramji" />


<title>OHI 2024: Natural Products, Preparing catch and B/Bmsy data for forage fish species</title>
Expand Down Expand Up @@ -1647,7 +1647,7 @@

<h1 class="title toc-ignore">OHI 2024: Natural Products, Preparing catch
and B/Bmsy data for forage fish species</h1>
<h4 class="author"><em>Compiled on Mon Aug 19 17:18:37 2024 by
<h4 class="author"><em>Compiled on Tue Aug 27 16:14:14 2024 by
ramji</em></h4>

</div>
Expand Down Expand Up @@ -1837,7 +1837,7 @@ <h2>Create a master list of forage species</h2>
<div id="read-in-v2022-catch-data" class="section level2">
<h2>Read in (v2022) catch data</h2>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" tabindex="-1"></a><span class="co"># This was not updated in v2023 or 2024 so we call out to the v2022 year on Mazu</span></span>
<span id="cb5-2"><a href="#cb5-2" tabindex="-1"></a>file <span class="ot">&lt;-</span> <span class="fu">file.path</span>(dir_M,<span class="st">&#39;git-annex/globalprep/fis/v2022/int/stock_catch_by_rgn_taxa.csv&#39;</span>)</span>
<span id="cb5-2"><a href="#cb5-2" tabindex="-1"></a>file <span class="ot">&lt;-</span> <span class="fu">file.path</span>(dir_M, <span class="st">&#39;git-annex/globalprep/fis/v2022/int/stock_catch_by_rgn_taxa.csv&#39;</span>)</span>
<span id="cb5-3"><a href="#cb5-3" tabindex="-1"></a></span>
<span id="cb5-4"><a href="#cb5-4" tabindex="-1"></a><span class="co"># read in Sea Around Us catch data</span></span>
<span id="cb5-5"><a href="#cb5-5" tabindex="-1"></a>catch_raw <span class="ot">&lt;-</span> readr<span class="sc">::</span><span class="fu">read_csv</span>(file) </span>
Expand Down
3 changes: 2 additions & 1 deletion globalprep/np/v2024/STEP2_np_weighting_prep.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ output:
pdf_document:
toc: true
editor_options:
chunk_output_type: inline
markdown:
wrap: 72
---
Expand Down Expand Up @@ -194,7 +195,7 @@ rgns_eez <- rgns_eez %>%
products <- data.frame(product = c("seaweeds", "ornamentals", "fish_oil"))
# Create full rgn x product x years dataframe
region_product_test <- rgns_eez %>%
region_product <- rgns_eez %>%
dplyr::select(rgn_id) %>% # select rgn_id from rgns_eez
cross_join(products) %>% # cross join with products (match every row in x with every row in y)
cross_join(years_df) # cross join with years
Expand Down
150 changes: 75 additions & 75 deletions globalprep/np/v2024/int/orn_tonnes.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ rgn_id,product,tonnes,year
3,ornamentals,0,2024
4,ornamentals,0,2024
5,ornamentals,3.2,2024
6,ornamentals,4.61741404504902,2024
6,ornamentals,0,2024
7,ornamentals,0,2024
8,ornamentals,2.7360748716512653,2024
9,ornamentals,0.34197464973123815,2024
8,ornamentals,1.7550055243212195,2024
9,ornamentals,0,2024
10,ornamentals,0,2024
11,ornamentals,0.25875420970785895,2024
11,ornamentals,0,2024
12,ornamentals,0,2024
13,ornamentals,0,2024
14,ornamentals,42.1975,2024
15,ornamentals,5591.2315,2024
16,ornamentals,137.79129430005045,2024
17,ornamentals,6.22,2024
18,ornamentals,127.614,2024
14,ornamentals,24.1,2024
15,ornamentals,0,2024
16,ornamentals,0,2024
17,ornamentals,0.24586557855756866,2024
18,ornamentals,39.45,2024
19,ornamentals,0,2024
20,ornamentals,0.18075530291330194,2024
20,ornamentals,0.12430547813415416,2024
21,ornamentals,0,2024
24,ornamentals,0,2024
25,ornamentals,653.0095,2024
25,ornamentals,4.25,2024
26,ornamentals,0,2024
28,ornamentals,0,2024
29,ornamentals,0,2024
Expand All @@ -32,49 +32,49 @@ rgn_id,product,tonnes,year
34,ornamentals,0,2024
35,ornamentals,0,2024
36,ornamentals,0,2024
37,ornamentals,5.049,2024
37,ornamentals,3.8,2024
38,ornamentals,0,2024
39,ornamentals,302.6565,2024
40,ornamentals,234.814,2024
39,ornamentals,0,2024
40,ornamentals,0,2024
41,ornamentals,0.05,2024
42,ornamentals,0.3715,2024
43,ornamentals,174.40200000000002,2024
42,ornamentals,0.15,2024
43,ornamentals,20.25,2024
44,ornamentals,0,2024
45,ornamentals,0,2024
46,ornamentals,0,2024
47,ornamentals,0.1,2024
47,ornamentals,0,2024
48,ornamentals,0,2024
49,ornamentals,0,2024
50,ornamentals,0,2024
51,ornamentals,0,2024
52,ornamentals,2.43,2024
53,ornamentals,44.138,2024
54,ornamentals,8.0655,2024
52,ornamentals,0,2024
53,ornamentals,7.1,2024
54,ornamentals,0,2024
55,ornamentals,0,2024
56,ornamentals,0,2024
57,ornamentals,0,2024
58,ornamentals,0,2024
59,ornamentals,5.7090000000000005,2024
59,ornamentals,2.4,2024
60,ornamentals,0,2024
61,ornamentals,0,2024
62,ornamentals,0,2024
63,ornamentals,0,2024
64,ornamentals,0,2024
65,ornamentals,0,2024
66,ornamentals,0,2024
67,ornamentals,601.88,2024
67,ornamentals,0,2024
68,ornamentals,0,2024
69,ornamentals,0,2024
70,ornamentals,0,2024
71,ornamentals,172.868,2024
71,ornamentals,0,2024
72,ornamentals,0,2024
73,ornamentals,0,2024
74,ornamentals,0,2024
75,ornamentals,0,2024
76,ornamentals,1.6805,2024
77,ornamentals,0.49918586123419434,2024
78,ornamentals,1.343,2024
79,ornamentals,2.207010771305258,2024
76,ornamentals,0.65,2024
77,ornamentals,0,2024
78,ornamentals,0.2,2024
79,ornamentals,0.26657143336115147,2024
80,ornamentals,0,2024
81,ornamentals,0,2024
82,ornamentals,0,2024
Expand All @@ -94,20 +94,20 @@ rgn_id,product,tonnes,year
98,ornamentals,0,2024
99,ornamentals,0,2024
100,ornamentals,0,2024
101,ornamentals,0.025,2024
102,ornamentals,10.86,2024
101,ornamentals,0,2024
102,ornamentals,5.7,2024
103,ornamentals,0,2024
104,ornamentals,0,2024
105,ornamentals,0,2024
106,ornamentals,23.285,2024
106,ornamentals,0.35,2024
107,ornamentals,0,2024
108,ornamentals,0,2024
110,ornamentals,0,2024
111,ornamentals,0,2024
112,ornamentals,3.7815,2024
112,ornamentals,1.9,2024
113,ornamentals,0,2024
114,ornamentals,9.451162409145935,2024
115,ornamentals,1.9234546726071866,2024
114,ornamentals,0,2024
115,ornamentals,0,2024
116,ornamentals,0,2024
117,ornamentals,0,2024
118,ornamentals,0,2024
Expand All @@ -118,94 +118,94 @@ rgn_id,product,tonnes,year
123,ornamentals,0,2024
124,ornamentals,0,2024
125,ornamentals,0,2024
126,ornamentals,6.0765,2024
126,ornamentals,0,2024
127,ornamentals,0,2024
129,ornamentals,0,2024
130,ornamentals,18.7115,2024
131,ornamentals,114.038,2024
132,ornamentals,67.6065,2024
130,ornamentals,2.65,2024
131,ornamentals,9.85,2024
132,ornamentals,0,2024
133,ornamentals,0,2024
134,ornamentals,0,2024
135,ornamentals,7.983337888470418,2024
135,ornamentals,6.927561280082898,2024
136,ornamentals,0,2024
137,ornamentals,4.501,2024
138,ornamentals,16.166,2024
137,ornamentals,3.3,2024
138,ornamentals,16.1,2024
139,ornamentals,0,2024
140,ornamentals,0,2024
141,ornamentals,0,2024
143,ornamentals,0,2024
144,ornamentals,0,2024
145,ornamentals,0,2024
146,ornamentals,0,2024
147,ornamentals,40.13,2024
147,ornamentals,1.05,2024
148,ornamentals,0,2024
149,ornamentals,0,2024
150,ornamentals,0,2024
151,ornamentals,0,2024
152,ornamentals,0,2024
153,ornamentals,0.7623480747042777,2024
153,ornamentals,0,2024
154,ornamentals,0,2024
155,ornamentals,0,2024
156,ornamentals,0,2024
157,ornamentals,0,2024
158,ornamentals,0,2024
159,ornamentals,0,2024
161,ornamentals,0,2024
162,ornamentals,0.2915,2024
163,ornamentals,3.25125846040474e-4,2024
162,ornamentals,0,2024
163,ornamentals,0,2024
164,ornamentals,0,2024
166,ornamentals,0,2024
167,ornamentals,4.712,2024
168,ornamentals,1.554,2024
167,ornamentals,4.05,2024
168,ornamentals,0,2024
169,ornamentals,0,2024
171,ornamentals,2.823,2024
171,ornamentals,1.8,2024
172,ornamentals,0,2024
173,ornamentals,0,2024
174,ornamentals,0,2024
175,ornamentals,3.7645,2024
176,ornamentals,1.4565000000000001,2024
177,ornamentals,931.5725,2024
178,ornamentals,0.2485,2024
179,ornamentals,42.598,2024
180,ornamentals,101.3845,2024
181,ornamentals,1.6335,2024
182,ornamentals,5330.178,2024
183,ornamentals,41.086,2024
184,ornamentals,48.0705,2024
175,ornamentals,3.75,2024
176,ornamentals,1.1,2024
177,ornamentals,0,2024
178,ornamentals,0,2024
179,ornamentals,28.2,2024
180,ornamentals,5.6,2024
181,ornamentals,1.2,2024
182,ornamentals,0,2024
183,ornamentals,18.9,2024
184,ornamentals,21.3,2024
185,ornamentals,0,2024
186,ornamentals,0,2024
187,ornamentals,0,2024
188,ornamentals,0,2024
189,ornamentals,21.5725,2024
189,ornamentals,0,2024
190,ornamentals,0,2024
191,ornamentals,140.3075,2024
191,ornamentals,8.3,2024
192,ornamentals,0,2024
193,ornamentals,0,2024
194,ornamentals,0,2024
195,ornamentals,0,2024
196,ornamentals,3.1799999999999997,2024
196,ornamentals,0,2024
197,ornamentals,0,2024
198,ornamentals,0,2024
199,ornamentals,0.6085,2024
199,ornamentals,0,2024
200,ornamentals,0,2024
202,ornamentals,144.15,2024
203,ornamentals,62.979,2024
202,ornamentals,9.086901564891923,2024
203,ornamentals,22,2024
204,ornamentals,0,2024
205,ornamentals,55.094845472663856,2024
206,ornamentals,0.4377968394194891,2024
207,ornamentals,625.3974567651605,2024
208,ornamentals,673.2823599598491,2024
209,ornamentals,0.014000000000000002,2024
210,ornamentals,2.6125000000000003,2024
212,ornamentals,0.4002279063750713,2024
214,ornamentals,54.116,2024
205,ornamentals,0,2024
206,ornamentals,0,2024
207,ornamentals,0,2024
208,ornamentals,0,2024
209,ornamentals,0,2024
210,ornamentals,1.8,2024
212,ornamentals,0,2024
214,ornamentals,13.1,2024
215,ornamentals,0,2024
216,ornamentals,613.645,2024
218,ornamentals,0.2455,2024
216,ornamentals,0,2024
218,ornamentals,0.15,2024
219,ornamentals,0,2024
220,ornamentals,0,2024
221,ornamentals,0,2024
222,ornamentals,2.0615,2024
222,ornamentals,1.9,2024
223,ornamentals,0,2024
224,ornamentals,0,2024
227,ornamentals,0,2024
Expand All @@ -218,4 +218,4 @@ rgn_id,product,tonnes,year
247,ornamentals,0,2024
248,ornamentals,0,2024
249,ornamentals,0,2024
250,ornamentals,2.96,2024
250,ornamentals,2.8,2024
Loading

0 comments on commit d0b4d5f

Please sign in to comment.