forked from gavinfay/fluke-mafmc-recdisc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpdmultiplied_regdistinct_sandbox_kam_diffseason.Rmd
520 lines (479 loc) · 42.7 KB
/
pdmultiplied_regdistinct_sandbox_kam_diffseason.Rmd
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
---
title: "pdmultiplied_regdistinct_sandbox_kam_diffseason"
author: "Kamran Walsh"
date: "2024-04-11"
output: html_document
---
Script for populating blank input tables with catch information from HCR/regulation testing with period multiplier based off of 2019 regulations
```{r}
getwd()
library(dplyr)
library(tidyr)
CatchTable_NYRegs <- readRDS("CatchTable_NYRegs")
inputtable <- readRDS('regulations_option1.rds')
blankinput <- readRDS("blankinputtables.rds")
```
NJ
```{r}
NJtableHCR <- CatchTable_NYRegs %>%
filter(State == "NJ")
for (x in 1:18){
NJinput2 <- blankinput$NJinput2
if(NJtableHCR$SeasonLen[x]==60){NJinput2$fluke_bag[13:16] = NJtableHCR$Bag[x]; NJinput2$fluke_min[13:16] = NJtableHCR$MinLen[x]} else
if(NJtableHCR$SeasonLen[x]==75){NJinput2$fluke_bag[12:16] = NJtableHCR$Bag[x]; NJinput2$fluke_min[12:16] = NJtableHCR$MinLen[x]} else
if (NJtableHCR$SeasonLen[x]==90){NJinput2$fluke_bag[11:16] = NJtableHCR$Bag[x]; NJinput2$fluke_min[11:16] = NJtableHCR$MinLen[x]} else
if (NJtableHCR$SeasonLen[x]==105){NJinput2$fluke_bag[10:16] = NJtableHCR$Bag[x]; NJinput2$fluke_min[10:16] = NJtableHCR$MinLen[x]} else
if (NJtableHCR$SeasonLen[x]==120){NJinput2$fluke_bag[9:16] = NJtableHCR$Bag[x]; NJinput2$fluke_min[9:16] = NJtableHCR$MinLen[x]} else
if (NJtableHCR$SeasonLen[x]==135){NJinput2$fluke_bag[9:17] = NJtableHCR$Bag[x]; NJinput2$fluke_min[9:17] = NJtableHCR$MinLen[x]} else
if (NJtableHCR$SeasonLen[x]==150){NJinput2$fluke_bag[9:18] = NJtableHCR$Bag[x]; NJinput2$fluke_min[9:18] = NJtableHCR$MinLen[x]} else
if (NJtableHCR$SeasonLen[x]==165){NJinput2$fluke_bag[9:19] = NJtableHCR$Bag[x]; NJinput2$fluke_min[9:19] = NJtableHCR$MinLen[x]} else
if (NJtableHCR$SeasonLen[x]==180){NJinput2$fluke_bag[9:20] = NJtableHCR$Bag[x]; NJinput2$fluke_min[9:20] = NJtableHCR$MinLen[x]} else
if (NJtableHCR$SeasonLen[x]==195){NJinput2$fluke_bag[8:20] = NJtableHCR$Bag[x]; NJinput2$fluke_min[8:20] = NJtableHCR$MinLen[x]} else
if (NJtableHCR$SeasonLen[x]==210){NJinput2$fluke_bag[7:20] = NJtableHCR$Bag[x]; NJinput2$fluke_min[7:20] = NJtableHCR$MinLen[x]; NJinput2$pd_multiplier[8] <- 2} else
if (NJtableHCR$SeasonLen[x]==225){NJinput2$fluke_bag[6:20] = NJtableHCR$Bag[x]; NJinput2$fluke_min[6:20] = NJtableHCR$MinLen[x]; NJinput2$pd_multiplier[8] <- 3} else
if (NJtableHCR$SeasonLen[x]==240){NJinput2$fluke_bag[5:20] = NJtableHCR$Bag[x]; NJinput2$fluke_min[5:20] = NJtableHCR$MinLen[x]; NJinput2$pd_multiplier[8] <- 4} else
if (NJtableHCR$SeasonLen[x]==255){NJinput2$fluke_bag[5:21] = NJtableHCR$Bag[x]; NJinput2$fluke_min[5:21] = NJtableHCR$MinLen[x]; NJinput2$pd_multiplier[8] <- 4} else
if (NJtableHCR$SeasonLen[x]==270){NJinput2$fluke_bag[5:22] = NJtableHCR$Bag[x]; NJinput2$fluke_min[5:22] = NJtableHCR$MinLen[x]; NJinput2$pd_multiplier[8] <- 4} else
if (NJtableHCR$SeasonLen[x]==285){NJinput2$fluke_bag[5:23] = NJtableHCR$Bag[x]; NJinput2$fluke_min[5:23] = NJtableHCR$MinLen[x]; NJinput2$pd_multiplier[8] <- 4; NJinput2$pd_multiplier[22] <- 2} else
if (NJtableHCR$SeasonLen[x]==300){NJinput2$fluke_bag[5:24] = NJtableHCR$Bag[x]; NJinput2$fluke_min[5:24] = NJtableHCR$MinLen[x]; NJinput2$pd_multiplier[8] <- 4; NJinput2$pd_multiplier[22] <- 3}
NJinput2$fluke_bag <- ifelse(is.na(NJinput2$fluke_bag), 0, NJtableHCR$Bag[x])
NJinput2$fluke_min <- ifelse(is.na(NJinput2$fluke_min), 100, NJtableHCR$MinLen[x])
if (NJinput2$fluke_bag[10]!=0){NJinput2$pd_multiplier[10] <- 2}
if (NJinput2$fluke_bag[18]!=0){NJinput2$pd_multiplier[18] <- 2.5}
NJinputmiddleman <- na.omit(NJinput2)
if (x==1){NJinputseasonHCRminus10 <- NJinputmiddleman}
if (x==2){NJinputseasonHCRplus10 <- NJinputmiddleman}
if (x==3){NJinputseasonHCRminus20 <- NJinputmiddleman}
if (x==4){NJinputseasonHCRplus20 <- NJinputmiddleman}
if (x==5){NJinputseasonHCRminus40 <- NJinputmiddleman}
if (x==6){NJinputseasonHCRplus40 <- NJinputmiddleman}
if (x==7){NJinputsizeHCRminus10 <- NJinputmiddleman}
if (x==8){NJinputsizeHCRplus10 <- NJinputmiddleman}
if (x==9){NJinputsizeHCRminus20 <- NJinputmiddleman}
if (x==10){NJinputsizeHCRplus20 <- NJinputmiddleman}
if (x==11){NJinputsizeHCRminus40 <- NJinputmiddleman}
if (x==12){NJinputsizeHCRplus40 <- NJinputmiddleman}
if (x==13){NJinputbagHCRminus10 <- NJinputmiddleman}
if (x==14){NJinputbagHCRplus10 <- NJinputmiddleman}
if (x==15){NJinputbagHCRminus20 <- NJinputmiddleman}
if (x==16){NJinputbagHCRplus20 <- NJinputmiddleman}
if (x==17){NJinputbagHCRminus40 <- NJinputmiddleman}
if (x==18){NJinputbagHCRplus40 <- NJinputmiddleman}
}
```
NY
```{r}
NYtableHCR <- CatchTable_NYRegs %>%
filter(State == "NY")
for (x in 1:18){
NYinput2 <- blankinput$NYinput2
if(NYtableHCR$SeasonLen[x]==60){NYinput2$fluke_bag[13:16] = NYtableHCR$Bag[x]; NYinput2$fluke_min[13:16] = NYtableHCR$MinLen[x]} else
if(NYtableHCR$SeasonLen[x]==75){NYinput2$fluke_bag[12:16] = NYtableHCR$Bag[x]; NYinput2$fluke_min[12:16] = NYtableHCR$MinLen[x]} else
if (NYtableHCR$SeasonLen[x]==90){NYinput2$fluke_bag[11:16] = NYtableHCR$Bag[x]; NYinput2$fluke_min[11:16] = NYtableHCR$MinLen[x]} else
if (NYtableHCR$SeasonLen[x]==105){NYinput2$fluke_bag[10:16] = NYtableHCR$Bag[x]; NYinput2$fluke_min[10:16] = NYtableHCR$MinLen[x]} else
if (NYtableHCR$SeasonLen[x]==120){NYinput2$fluke_bag[9:16] = NYtableHCR$Bag[x]; NYinput2$fluke_min[9:16] = NYtableHCR$MinLen[x]} else
if (NYtableHCR$SeasonLen[x]==135){NYinput2$fluke_bag[9:17] = NYtableHCR$Bag[x]; NYinput2$fluke_min[9:17] = NYtableHCR$MinLen[x]} else
if (NYtableHCR$SeasonLen[x]==150){NYinput2$fluke_bag[9:18] = NYtableHCR$Bag[x]; NYinput2$fluke_min[9:18] = NYtableHCR$MinLen[x]} else
if (NYtableHCR$SeasonLen[x]==165){NYinput2$fluke_bag[9:19] = NYtableHCR$Bag[x]; NYinput2$fluke_min[9:19] = NYtableHCR$MinLen[x]} else
if (NYtableHCR$SeasonLen[x]==180){NYinput2$fluke_bag[9:20] = NYtableHCR$Bag[x]; NYinput2$fluke_min[9:20] = NYtableHCR$MinLen[x]} else
if (NYtableHCR$SeasonLen[x]==195){NYinput2$fluke_bag[8:20] = NYtableHCR$Bag[x]; NYinput2$fluke_min[8:20] = NYtableHCR$MinLen[x]} else
if (NYtableHCR$SeasonLen[x]==210){NYinput2$fluke_bag[7:20] = NYtableHCR$Bag[x]; NYinput2$fluke_min[7:20] = NYtableHCR$MinLen[x]} else
if (NYtableHCR$SeasonLen[x]==225){NYinput2$fluke_bag[6:20] = NYtableHCR$Bag[x]; NYinput2$fluke_min[6:20] = NYtableHCR$MinLen[x]} else
if (NYtableHCR$SeasonLen[x]==240){NYinput2$fluke_bag[5:20] = NYtableHCR$Bag[x]; NYinput2$fluke_min[5:20] = NYtableHCR$MinLen[x]; NYinput2$pd_multiplier[6] <- 2} else
if (NYtableHCR$SeasonLen[x]==255){NYinput2$fluke_bag[5:21] = NYtableHCR$Bag[x]; NYinput2$fluke_min[5:21] = NYtableHCR$MinLen[x]; NYinput2$pd_multiplier[6] <- 2; NYinput2$pd_multiplier[20] <- 2} else
if (NYtableHCR$SeasonLen[x]==270){NYinput2$fluke_bag[5:22] = NYtableHCR$Bag[x]; NYinput2$fluke_min[5:22] = NYtableHCR$MinLen[x]; NYinput2$pd_multiplier[6] <- 2; NYinput2$pd_multiplier[20] <- 3} else
if (NYtableHCR$SeasonLen[x]==285){NYinput2$fluke_bag[5:23] = NYtableHCR$Bag[x]; NYinput2$fluke_min[5:23] = NYtableHCR$MinLen[x]; NYinput2$pd_multiplier[6] <- 2; NYinput2$pd_multiplier[20] <- 4} else
if (NYtableHCR$SeasonLen[x]==300){NYinput2$fluke_bag[5:24] = NYtableHCR$Bag[x]; NYinput2$fluke_min[5:24] = NYtableHCR$MinLen[x]; NYinput2$pd_multiplier[6] <- 2; NYinput2$pd_multiplier[20] <- 5}
NYinput2$fluke_bag <- ifelse(is.na(NYinput2$fluke_bag), 0, NYtableHCR$Bag[x])
NYinput2$fluke_min <- ifelse(is.na(NYinput2$fluke_min), 100, NYtableHCR$MinLen[x])
if (NYinput2$fluke_bag[9]!=0){NYinput2$pd_multiplier[9] <- 1.25}
NYinputmiddleman <- na.omit(NYinput2)
if (x==1){NYinputseasonHCRminus10 <- NYinputmiddleman}
if (x==2){NYinputseasonHCRplus10 <- NYinputmiddleman}
if (x==3){NYinputseasonHCRminus20 <- NYinputmiddleman}
if (x==4){NYinputseasonHCRplus20 <- NYinputmiddleman}
if (x==5){NYinputseasonHCRminus40 <- NYinputmiddleman}
if (x==6){NYinputseasonHCRplus40 <- NYinputmiddleman}
if (x==7){NYinputsizeHCRminus10 <- NYinputmiddleman}
if (x==8){NYinputsizeHCRplus10 <- NYinputmiddleman}
if (x==9){NYinputsizeHCRminus20 <- NYinputmiddleman}
if (x==10){NYinputsizeHCRplus20 <- NYinputmiddleman}
if (x==11){NYinputsizeHCRminus40 <- NYinputmiddleman}
if (x==12){NYinputsizeHCRplus40 <- NYinputmiddleman}
if (x==13){NYinputbagHCRminus10 <- NYinputmiddleman}
if (x==14){NYinputbagHCRplus10 <- NYinputmiddleman}
if (x==15){NYinputbagHCRminus20 <- NYinputmiddleman}
if (x==16){NYinputbagHCRplus20 <- NYinputmiddleman}
if (x==17){NYinputbagHCRminus40 <- NYinputmiddleman}
if (x==18){NYinputbagHCRplus40 <- NYinputmiddleman}
}
```
NC
```{r}
NCtableHCR <- CatchTable_NYRegs %>%
filter(State == "NC")
for (x in 1:18){
NCinput2 <- blankinput$NCinput2
if(NCtableHCR$SeasonLen[x]==60){NCinput2$fluke_bag[13:16] = NCtableHCR$Bag[x]; NCinput2$fluke_min[13:16] = NCtableHCR$MinLen[x]} else
if(NCtableHCR$SeasonLen[x]==75){NCinput2$fluke_bag[12:16] = NCtableHCR$Bag[x]; NCinput2$fluke_min[12:16] = NCtableHCR$MinLen[x]} else
if (NCtableHCR$SeasonLen[x]==90){NCinput2$fluke_bag[11:16] = NCtableHCR$Bag[x]; NCinput2$fluke_min[11:16] = NCtableHCR$MinLen[x]} else
if (NCtableHCR$SeasonLen[x]==105){NCinput2$fluke_bag[10:16] = NCtableHCR$Bag[x]; NCinput2$fluke_min[10:16] = NCtableHCR$MinLen[x]} else
if (NCtableHCR$SeasonLen[x]==120){NCinput2$fluke_bag[9:16] = NCtableHCR$Bag[x]; NCinput2$fluke_min[9:16] = NCtableHCR$MinLen[x]} else
if (NCtableHCR$SeasonLen[x]==135){NCinput2$fluke_bag[9:17] = NCtableHCR$Bag[x]; NCinput2$fluke_min[9:17] = NCtableHCR$MinLen[x]} else
if (NCtableHCR$SeasonLen[x]==150){NCinput2$fluke_bag[9:18] = NCtableHCR$Bag[x]; NCinput2$fluke_min[9:18] = NCtableHCR$MinLen[x]} else
if (NCtableHCR$SeasonLen[x]==165){NCinput2$fluke_bag[9:19] = NCtableHCR$Bag[x]; NCinput2$fluke_min[9:19] = NCtableHCR$MinLen[x]} else
if (NCtableHCR$SeasonLen[x]==180){NCinput2$fluke_bag[9:20] = NCtableHCR$Bag[x]; NCinput2$fluke_min[9:20] = NCtableHCR$MinLen[x]} else
if (NCtableHCR$SeasonLen[x]==195){NCinput2$fluke_bag[8:20] = NCtableHCR$Bag[x]; NCinput2$fluke_min[8:20] = NCtableHCR$MinLen[x]} else
if (NCtableHCR$SeasonLen[x]==210){NCinput2$fluke_bag[7:20] = NCtableHCR$Bag[x]; NCinput2$fluke_min[7:20] = NCtableHCR$MinLen[x]; NCinput2$pd_multiplier[8] <- 2} else
if (NCtableHCR$SeasonLen[x]==225){NCinput2$fluke_bag[6:20] = NCtableHCR$Bag[x]; NCinput2$fluke_min[6:20] = NCtableHCR$MinLen[x]; NCinput2$pd_multiplier[8] <- 3} else
if (NCtableHCR$SeasonLen[x]==240){NCinput2$fluke_bag[5:20] = NCtableHCR$Bag[x]; NCinput2$fluke_min[5:20] = NCtableHCR$MinLen[x]; NCinput2$pd_multiplier[8] <- 4} else
if (NCtableHCR$SeasonLen[x]==255){NCinput2$fluke_bag[5:21] = NCtableHCR$Bag[x]; NCinput2$fluke_min[5:21] = NCtableHCR$MinLen[x]; NCinput2$pd_multiplier[8] <- 4; NCinput2$pd_multiplier[20] <- 2} else
if (NCtableHCR$SeasonLen[x]==270){NCinput2$fluke_bag[5:22] = NCtableHCR$Bag[x]; NCinput2$fluke_min[5:22] = NCtableHCR$MinLen[x]; NCinput2$pd_multiplier[8] <- 4; NCinput2$pd_multiplier[20] <- 3} else
if (NCtableHCR$SeasonLen[x]==285){NCinput2$fluke_bag[5:23] = NCtableHCR$Bag[x]; NCinput2$fluke_min[5:23] = NCtableHCR$MinLen[x]; NCinput2$pd_multiplier[8] <- 4; NCinput2$pd_multiplier[20] <- 4} else
if (NCtableHCR$SeasonLen[x]==300){NCinput2$fluke_bag[5:24] = NCtableHCR$Bag[x]; NCinput2$fluke_min[5:24] = NCtableHCR$MinLen[x]; NCinput2$pd_multiplier[8] <- 4; NCinput2$pd_multiplier[20] <- 5}
NCinput2$fluke_bag <- ifelse(is.na(NCinput2$fluke_bag), 0, NCtableHCR$Bag[x])
NCinput2$fluke_min <- ifelse(is.na(NCinput2$fluke_min), 100, NCtableHCR$MinLen[x])
if (NCinput2$fluke_bag[16]!=0){NCinput2$pd_multiplier[16] <- 2}
NCinputmiddleman <- na.omit(NCinput2)
if (x==1){NCinputseasonHCRminus10 <- NCinputmiddleman}
if (x==2){NCinputseasonHCRplus10 <- NCinputmiddleman}
if (x==3){NCinputseasonHCRminus20 <- NCinputmiddleman}
if (x==4){NCinputseasonHCRplus20 <- NCinputmiddleman}
if (x==5){NCinputseasonHCRminus40 <- NCinputmiddleman}
if (x==6){NCinputseasonHCRplus40 <- NCinputmiddleman}
if (x==7){NCinputsizeHCRminus10 <- NCinputmiddleman}
if (x==8){NCinputsizeHCRplus10 <- NCinputmiddleman}
if (x==9){NCinputsizeHCRminus20 <- NCinputmiddleman}
if (x==10){NCinputsizeHCRplus20 <- NCinputmiddleman}
if (x==11){NCinputsizeHCRminus40 <- NCinputmiddleman}
if (x==12){NCinputsizeHCRplus40 <- NCinputmiddleman}
if (x==13){NCinputbagHCRminus10 <- NCinputmiddleman}
if (x==14){NCinputbagHCRplus10 <- NCinputmiddleman}
if (x==15){NCinputbagHCRminus20 <- NCinputmiddleman}
if (x==16){NCinputbagHCRplus20 <- NCinputmiddleman}
if (x==17){NCinputbagHCRminus40 <- NCinputmiddleman}
if (x==18){NCinputbagHCRplus40 <- NCinputmiddleman}
}
```
RI
```{r}
RItableHCR <- CatchTable_NYRegs %>%
filter(State == "RI")
for (x in 1:18){
RIinput2 <- blankinput$RIinput2
if(RItableHCR$SeasonLen[x]==60){RIinput2$fluke_bag[13:16] = RItableHCR$Bag[x]; RIinput2$fluke_min[13:16] = RItableHCR$MinLen[x]} else
if(RItableHCR$SeasonLen[x]==75){RIinput2$fluke_bag[12:16] = RItableHCR$Bag[x]; RIinput2$fluke_min[12:16] = RItableHCR$MinLen[x]} else
if (RItableHCR$SeasonLen[x]==90){RIinput2$fluke_bag[11:16] = RItableHCR$Bag[x]; RIinput2$fluke_min[11:16] = RItableHCR$MinLen[x]} else
if (RItableHCR$SeasonLen[x]==105){RIinput2$fluke_bag[10:16] = RItableHCR$Bag[x]; RIinput2$fluke_min[10:16] = RItableHCR$MinLen[x]} else
if (RItableHCR$SeasonLen[x]==120){RIinput2$fluke_bag[9:16] = RItableHCR$Bag[x]; RIinput2$fluke_min[9:16] = RItableHCR$MinLen[x]; RIinput2$pd_multiplier[9] <- (1/0.867)} else
if (RItableHCR$SeasonLen[x]==135){RIinput2$fluke_bag[9:17] = RItableHCR$Bag[x]; RIinput2$fluke_min[9:17] = RItableHCR$MinLen[x]; RIinput2$pd_multiplier[9] <- (1/0.867)} else
if (RItableHCR$SeasonLen[x]==150){RIinput2$fluke_bag[9:18] = RItableHCR$Bag[x]; RIinput2$fluke_min[9:18] = RItableHCR$MinLen[x]; RIinput2$pd_multiplier[9] <- (1/0.867)} else
if (RItableHCR$SeasonLen[x]==165){RIinput2$fluke_bag[9:19] = RItableHCR$Bag[x]; RIinput2$fluke_min[9:19] = RItableHCR$MinLen[x]; RIinput2$pd_multiplier[9] <- (1/0.867)} else
if (RItableHCR$SeasonLen[x]==180){RIinput2$fluke_bag[9:20] = RItableHCR$Bag[x]; RIinput2$fluke_min[9:20] = RItableHCR$MinLen[x]; RIinput2$pd_multiplier[9] <- (1/0.867)} else
if (RItableHCR$SeasonLen[x]==195){RIinput2$fluke_bag[8:20] = RItableHCR$Bag[x]; RIinput2$fluke_min[8:20] = RItableHCR$MinLen[x]; RIinput2$pd_multiplier[9] <- (1+(1/0.867))} else
if (RItableHCR$SeasonLen[x]==210){RIinput2$fluke_bag[7:20] = RItableHCR$Bag[x]; RIinput2$fluke_min[7:20] = RItableHCR$MinLen[x]; RIinput2$pd_multiplier[9] <- (2+(1/0.867))} else
if (RItableHCR$SeasonLen[x]==225){RIinput2$fluke_bag[6:20] = RItableHCR$Bag[x]; RIinput2$fluke_min[6:20] = RItableHCR$MinLen[x]; RIinput2$pd_multiplier[9] <- (3+(1/0.867))} else
if (RItableHCR$SeasonLen[x]==240){RIinput2$fluke_bag[5:20] = RItableHCR$Bag[x]; RIinput2$fluke_min[5:20] = RItableHCR$MinLen[x]; RIinput2$pd_multiplier[9] <- (4+(1/0.867))} else
if (RItableHCR$SeasonLen[x]==255){RIinput2$fluke_bag[5:21] = RItableHCR$Bag[x]; RIinput2$fluke_min[5:21] = RItableHCR$MinLen[x]; RIinput2$pd_multiplier[9] <- (4+(1/0.867))} else
if (RItableHCR$SeasonLen[x]==270){RIinput2$fluke_bag[5:22] = RItableHCR$Bag[x]; RIinput2$fluke_min[5:22] = RItableHCR$MinLen[x]; RIinput2$pd_multiplier[9] <- (4+(1/0.867)); RIinput2$pd_multiplier[21] <- 2} else
if (RItableHCR$SeasonLen[x]==285){RIinput2$fluke_bag[5:23] = RItableHCR$Bag[x]; RIinput2$fluke_min[5:23] = RItableHCR$MinLen[x]; RIinput2$pd_multiplier[9] <- (4+(1/0.867)); RIinput2$pd_multiplier[21] <- 3} else
if (RItableHCR$SeasonLen[x]==300){RIinput2$fluke_bag[5:24] = RItableHCR$Bag[x]; RIinput2$fluke_min[5:24] = RItableHCR$MinLen[x]; RIinput2$pd_multiplier[9] <- (4+(1/0.867)); RIinput2$pd_multiplier[21] <- 4}
RIinput2$fluke_bag <- ifelse(is.na(RIinput2$fluke_bag), 0, RItableHCR$Bag[x])
RIinput2$fluke_min <- ifelse(is.na(RIinput2$fluke_min), 100, RItableHCR$MinLen[x])
RIinputmiddleman <- na.omit(RIinput2)
if (x==1){RIinputseasonHCRminus10 <- RIinputmiddleman}
if (x==2){RIinputseasonHCRplus10 <- RIinputmiddleman}
if (x==3){RIinputseasonHCRminus20 <- RIinputmiddleman}
if (x==4){RIinputseasonHCRplus20 <- RIinputmiddleman}
if (x==5){RIinputseasonHCRminus40 <- RIinputmiddleman}
if (x==6){RIinputseasonHCRplus40 <- RIinputmiddleman}
if (x==7){RIinputsizeHCRminus10 <- RIinputmiddleman}
if (x==8){RIinputsizeHCRplus10 <- RIinputmiddleman}
if (x==9){RIinputsizeHCRminus20 <- RIinputmiddleman}
if (x==10){RIinputsizeHCRplus20 <- RIinputmiddleman}
if (x==11){RIinputsizeHCRminus40 <- RIinputmiddleman}
if (x==12){RIinputsizeHCRplus40 <- RIinputmiddleman}
if (x==13){RIinputbagHCRminus10 <- RIinputmiddleman}
if (x==14){RIinputbagHCRplus10 <- RIinputmiddleman}
if (x==15){RIinputbagHCRminus20 <- RIinputmiddleman}
if (x==16){RIinputbagHCRplus20 <- RIinputmiddleman}
if (x==17){RIinputbagHCRminus40 <- RIinputmiddleman}
if (x==18){RIinputbagHCRplus40 <- RIinputmiddleman}
}
```
MD
```{r}
MDtableHCR <- CatchTable_NYRegs %>%
filter(State == "MD")
for (x in 1:18){
MDinput2 <- blankinput$MDinput2
if(MDtableHCR$SeasonLen[x]==60){MDinput2$fluke_bag[13:16] = MDtableHCR$Bag[x]; MDinput2$fluke_min[13:16] = MDtableHCR$MinLen[x]} else
if(MDtableHCR$SeasonLen[x]==75){MDinput2$fluke_bag[12:16] = MDtableHCR$Bag[x]; MDinput2$fluke_min[12:16] = MDtableHCR$MinLen[x]} else
if (MDtableHCR$SeasonLen[x]==90){MDinput2$fluke_bag[11:16] = MDtableHCR$Bag[x]; MDinput2$fluke_min[11:16] = MDtableHCR$MinLen[x]} else
if (MDtableHCR$SeasonLen[x]==105){MDinput2$fluke_bag[10:16] = MDtableHCR$Bag[x]; MDinput2$fluke_min[10:16] = MDtableHCR$MinLen[x]} else
if (MDtableHCR$SeasonLen[x]==120){MDinput2$fluke_bag[9:16] = MDtableHCR$Bag[x]; MDinput2$fluke_min[9:16] = MDtableHCR$MinLen[x]} else
if (MDtableHCR$SeasonLen[x]==135){MDinput2$fluke_bag[9:17] = MDtableHCR$Bag[x]; MDinput2$fluke_min[9:17] = MDtableHCR$MinLen[x]} else
if (MDtableHCR$SeasonLen[x]==150){MDinput2$fluke_bag[9:18] = MDtableHCR$Bag[x]; MDinput2$fluke_min[9:18] = MDtableHCR$MinLen[x]} else
if (MDtableHCR$SeasonLen[x]==165){MDinput2$fluke_bag[9:19] = MDtableHCR$Bag[x]; MDinput2$fluke_min[9:19] = MDtableHCR$MinLen[x]} else
if (MDtableHCR$SeasonLen[x]==180){MDinput2$fluke_bag[9:20] = MDtableHCR$Bag[x]; MDinput2$fluke_min[9:20] = MDtableHCR$MinLen[x]} else
if (MDtableHCR$SeasonLen[x]==195){MDinput2$fluke_bag[8:20] = MDtableHCR$Bag[x]; MDinput2$fluke_min[8:20] = MDtableHCR$MinLen[x]} else
if (MDtableHCR$SeasonLen[x]==210){MDinput2$fluke_bag[7:20] = MDtableHCR$Bag[x]; MDinput2$fluke_min[7:20] = MDtableHCR$MinLen[x]} else
if (MDtableHCR$SeasonLen[x]==225){MDinput2$fluke_bag[6:20] = MDtableHCR$Bag[x]; MDinput2$fluke_min[6:20] = MDtableHCR$MinLen[x]; MDinput2$pd_multiplier[7] <- 2} else
if (MDtableHCR$SeasonLen[x]==240){MDinput2$fluke_bag[5:20] = MDtableHCR$Bag[x]; MDinput2$fluke_min[5:20] = MDtableHCR$MinLen[x]; MDinput2$pd_multiplier[7] <- 3} else
if (MDtableHCR$SeasonLen[x]==255){MDinput2$fluke_bag[5:21] = MDtableHCR$Bag[x]; MDinput2$fluke_min[5:21] = MDtableHCR$MinLen[x]; MDinput2$pd_multiplier[7] <- 3} else
if (MDtableHCR$SeasonLen[x]==270){MDinput2$fluke_bag[5:22] = MDtableHCR$Bag[x]; MDinput2$fluke_min[5:22] = MDtableHCR$MinLen[x]; MDinput2$pd_multiplier[7] <- 3; MDinput2$pd_multiplier[21] <- 2} else
if (MDtableHCR$SeasonLen[x]==285){MDinput2$fluke_bag[5:23] = MDtableHCR$Bag[x]; MDinput2$fluke_min[5:23] = MDtableHCR$MinLen[x]; MDinput2$pd_multiplier[7] <- 3; MDinput2$pd_multiplier[21] <- 3} else
if (MDtableHCR$SeasonLen[x]==300){MDinput2$fluke_bag[5:24] = MDtableHCR$Bag[x]; MDinput2$fluke_min[5:24] = MDtableHCR$MinLen[x]; MDinput2$pd_multiplier[7] <- 3; MDinput2$pd_multiplier[21] <- 4}
MDinput2$fluke_bag <- ifelse(is.na(MDinput2$fluke_bag), 0, MDtableHCR$Bag[x])
MDinput2$fluke_min <- ifelse(is.na(MDinput2$fluke_min), 100, MDtableHCR$MinLen[x])
MDinputmiddleman <- na.omit(MDinput2)
if (x==1){MDinputseasonHCRminus10 <- MDinputmiddleman}
if (x==2){MDinputseasonHCRplus10 <- MDinputmiddleman}
if (x==3){MDinputseasonHCRminus20 <- MDinputmiddleman}
if (x==4){MDinputseasonHCRplus20 <- MDinputmiddleman}
if (x==5){MDinputseasonHCRminus40 <- MDinputmiddleman}
if (x==6){MDinputseasonHCRplus40 <- MDinputmiddleman}
if (x==7){MDinputsizeHCRminus10 <- MDinputmiddleman}
if (x==8){MDinputsizeHCRplus10 <- MDinputmiddleman}
if (x==9){MDinputsizeHCRminus20 <- MDinputmiddleman}
if (x==10){MDinputsizeHCRplus20 <- MDinputmiddleman}
if (x==11){MDinputsizeHCRminus40 <- MDinputmiddleman}
if (x==12){MDinputsizeHCRplus40 <- MDinputmiddleman}
if (x==13){MDinputbagHCRminus10 <- MDinputmiddleman}
if (x==14){MDinputbagHCRplus10 <- MDinputmiddleman}
if (x==15){MDinputbagHCRminus20 <- MDinputmiddleman}
if (x==16){MDinputbagHCRplus20 <- MDinputmiddleman}
if (x==17){MDinputbagHCRminus40 <- MDinputmiddleman}
if (x==18){MDinputbagHCRplus40 <- MDinputmiddleman}
}
```
VA
```{r}
VAtableHCR <- CatchTable_NYRegs %>%
filter(State == "VA")
for (x in 1:18){
VAinput2 <- blankinput$VAinput2
if(VAtableHCR$SeasonLen[x]==60){VAinput2$fluke_bag[13:16] = VAtableHCR$Bag[x]; VAinput2$fluke_min[13:16] = VAtableHCR$MinLen[x]} else
if(VAtableHCR$SeasonLen[x]==75){VAinput2$fluke_bag[12:16] = VAtableHCR$Bag[x]; VAinput2$fluke_min[12:16] = VAtableHCR$MinLen[x]} else
if (VAtableHCR$SeasonLen[x]==90){VAinput2$fluke_bag[11:16] = VAtableHCR$Bag[x]; VAinput2$fluke_min[11:16] = VAtableHCR$MinLen[x]} else
if (VAtableHCR$SeasonLen[x]==105){VAinput2$fluke_bag[10:16] = VAtableHCR$Bag[x]; VAinput2$fluke_min[10:16] = VAtableHCR$MinLen[x]} else
if (VAtableHCR$SeasonLen[x]==120){VAinput2$fluke_bag[9:16] = VAtableHCR$Bag[x]; VAinput2$fluke_min[9:16] = VAtableHCR$MinLen[x]} else
if (VAtableHCR$SeasonLen[x]==135){VAinput2$fluke_bag[9:17] = VAtableHCR$Bag[x]; VAinput2$fluke_min[9:17] = VAtableHCR$MinLen[x]} else
if (VAtableHCR$SeasonLen[x]==150){VAinput2$fluke_bag[9:18] = VAtableHCR$Bag[x]; VAinput2$fluke_min[9:18] = VAtableHCR$MinLen[x]} else
if (VAtableHCR$SeasonLen[x]==165){VAinput2$fluke_bag[9:19] = VAtableHCR$Bag[x]; VAinput2$fluke_min[9:19] = VAtableHCR$MinLen[x]} else
if (VAtableHCR$SeasonLen[x]==180){VAinput2$fluke_bag[9:20] = VAtableHCR$Bag[x]; VAinput2$fluke_min[9:20] = VAtableHCR$MinLen[x]} else
if (VAtableHCR$SeasonLen[x]==195){VAinput2$fluke_bag[8:20] = VAtableHCR$Bag[x]; VAinput2$fluke_min[8:20] = VAtableHCR$MinLen[x]} else
if (VAtableHCR$SeasonLen[x]==210){VAinput2$fluke_bag[7:20] = VAtableHCR$Bag[x]; VAinput2$fluke_min[7:20] = VAtableHCR$MinLen[x]} else
if (VAtableHCR$SeasonLen[x]==225){VAinput2$fluke_bag[6:20] = VAtableHCR$Bag[x]; VAinput2$fluke_min[6:20] = VAtableHCR$MinLen[x]; VAinput2$pd_multiplier[7] <- 2} else
if (VAtableHCR$SeasonLen[x]==240){VAinput2$fluke_bag[5:20] = VAtableHCR$Bag[x]; VAinput2$fluke_min[5:20] = VAtableHCR$MinLen[x]; VAinput2$pd_multiplier[7] <- 3} else
if (VAtableHCR$SeasonLen[x]==255){VAinput2$fluke_bag[5:21] = VAtableHCR$Bag[x]; VAinput2$fluke_min[5:21] = VAtableHCR$MinLen[x]; VAinput2$pd_multiplier[7] <- 3} else
if (VAtableHCR$SeasonLen[x]==270){VAinput2$fluke_bag[5:22] = VAtableHCR$Bag[x]; VAinput2$fluke_min[5:22] = VAtableHCR$MinLen[x]; VAinput2$pd_multiplier[7] <- 3} else
if (VAtableHCR$SeasonLen[x]==285){VAinput2$fluke_bag[5:23] = VAtableHCR$Bag[x]; VAinput2$fluke_min[5:23] = VAtableHCR$MinLen[x]; VAinput2$pd_multiplier[7] <- 3; VAinput2$pd_multiplier[22] <- 2} else
if (VAtableHCR$SeasonLen[x]==300){VAinput2$fluke_bag[5:24] = VAtableHCR$Bag[x]; VAinput2$fluke_min[5:24] = VAtableHCR$MinLen[x]; VAinput2$pd_multiplier[7] <- 3; VAinput2$pd_multiplier[22] <- 3}
VAinput2$fluke_bag <- ifelse(is.na(VAinput2$fluke_bag), 0, VAtableHCR$Bag[x])
VAinput2$fluke_min <- ifelse(is.na(VAinput2$fluke_min), 100, VAtableHCR$MinLen[x])
VAinputmiddleman <- na.omit(VAinput2)
if (x==1){VAinputseasonHCRminus10 <- VAinputmiddleman}
if (x==2){VAinputseasonHCRplus10 <- VAinputmiddleman}
if (x==3){VAinputseasonHCRminus20 <- VAinputmiddleman}
if (x==4){VAinputseasonHCRplus20 <- VAinputmiddleman}
if (x==5){VAinputseasonHCRminus40 <- VAinputmiddleman}
if (x==6){VAinputseasonHCRplus40 <- VAinputmiddleman}
if (x==7){VAinputsizeHCRminus10 <- VAinputmiddleman}
if (x==8){VAinputsizeHCRplus10 <- VAinputmiddleman}
if (x==9){VAinputsizeHCRminus20 <- VAinputmiddleman}
if (x==10){VAinputsizeHCRplus20 <- VAinputmiddleman}
if (x==11){VAinputsizeHCRminus40 <- VAinputmiddleman}
if (x==12){VAinputsizeHCRplus40 <- VAinputmiddleman}
if (x==13){VAinputbagHCRminus10 <- VAinputmiddleman}
if (x==14){VAinputbagHCRplus10 <- VAinputmiddleman}
if (x==15){VAinputbagHCRminus20 <- VAinputmiddleman}
if (x==16){VAinputbagHCRplus20 <- VAinputmiddleman}
if (x==17){VAinputbagHCRminus40 <- VAinputmiddleman}
if (x==18){VAinputbagHCRplus40 <- VAinputmiddleman}
}
```
CT
```{r}
CTtableHCR <- CatchTable_NYRegs %>%
filter(State == "CT")
for (x in 1:18){
CTinput2 <- blankinput$CTinput2
if(CTtableHCR$SeasonLen[x]==60){CTinput2$fluke_bag[13:16] = CTtableHCR$Bag[x]; CTinput2$fluke_min[13:16] = CTtableHCR$MinLen[x]} else
if(CTtableHCR$SeasonLen[x]==75){CTinput2$fluke_bag[12:16] = CTtableHCR$Bag[x]; CTinput2$fluke_min[12:16] = CTtableHCR$MinLen[x]} else
if (CTtableHCR$SeasonLen[x]==90){CTinput2$fluke_bag[11:16] = CTtableHCR$Bag[x]; CTinput2$fluke_min[11:16] = CTtableHCR$MinLen[x]} else
if (CTtableHCR$SeasonLen[x]==105){CTinput2$fluke_bag[10:16] = CTtableHCR$Bag[x]; CTinput2$fluke_min[10:16] = CTtableHCR$MinLen[x]} else
if (CTtableHCR$SeasonLen[x]==120){CTinput2$fluke_bag[9:16] = CTtableHCR$Bag[x]; CTinput2$fluke_min[9:16] = CTtableHCR$MinLen[x]; CTinput2$pd_multiplier[9] <- 1.25} else
if (CTtableHCR$SeasonLen[x]==135){CTinput2$fluke_bag[9:17] = CTtableHCR$Bag[x]; CTinput2$fluke_min[9:17] = CTtableHCR$MinLen[x]; CTinput2$pd_multiplier[9] <- 1.25} else
if (CTtableHCR$SeasonLen[x]==150){CTinput2$fluke_bag[9:18] = CTtableHCR$Bag[x]; CTinput2$fluke_min[9:18] = CTtableHCR$MinLen[x]; CTinput2$pd_multiplier[9] <- 1.25} else
if (CTtableHCR$SeasonLen[x]==165){CTinput2$fluke_bag[9:19] = CTtableHCR$Bag[x]; CTinput2$fluke_min[9:19] = CTtableHCR$MinLen[x]; CTinput2$pd_multiplier[9] <- 1.25} else
if (CTtableHCR$SeasonLen[x]==180){CTinput2$fluke_bag[9:20] = CTtableHCR$Bag[x]; CTinput2$fluke_min[9:20] = CTtableHCR$MinLen[x]; CTinput2$pd_multiplier[9] <- 1.25} else
if (CTtableHCR$SeasonLen[x]==195){CTinput2$fluke_bag[8:20] = CTtableHCR$Bag[x]; CTinput2$fluke_min[8:20] = CTtableHCR$MinLen[x]; CTinput2$pd_multiplier[9] <- 2.25} else
if (CTtableHCR$SeasonLen[x]==210){CTinput2$fluke_bag[7:20] = CTtableHCR$Bag[x]; CTinput2$fluke_min[7:20] = CTtableHCR$MinLen[x]; CTinput2$pd_multiplier[9] <- 3.25} else
if (CTtableHCR$SeasonLen[x]==225){CTinput2$fluke_bag[6:20] = CTtableHCR$Bag[x]; CTinput2$fluke_min[6:20] = CTtableHCR$MinLen[x]; CTinput2$pd_multiplier[9] <- 4.25} else
if (CTtableHCR$SeasonLen[x]==240){CTinput2$fluke_bag[5:20] = CTtableHCR$Bag[x]; CTinput2$fluke_min[5:20] = CTtableHCR$MinLen[x]; CTinput2$pd_multiplier[9] <- 5.25} else
if (CTtableHCR$SeasonLen[x]==255){CTinput2$fluke_bag[5:21] = CTtableHCR$Bag[x]; CTinput2$fluke_min[5:21] = CTtableHCR$MinLen[x]; CTinput2$pd_multiplier[9] <- 5.25; CTinput2$pd_multiplier[20] <- 2} else
if (CTtableHCR$SeasonLen[x]==270){CTinput2$fluke_bag[5:22] = CTtableHCR$Bag[x]; CTinput2$fluke_min[5:22] = CTtableHCR$MinLen[x]; CTinput2$pd_multiplier[9] <- 5.25; CTinput2$pd_multiplier[20] <- 3} else
if (CTtableHCR$SeasonLen[x]==285){CTinput2$fluke_bag[5:23] = CTtableHCR$Bag[x]; CTinput2$fluke_min[5:23] = CTtableHCR$MinLen[x]; CTinput2$pd_multiplier[9] <- 5.25; CTinput2$pd_multiplier[20] <- 4} else
if (CTtableHCR$SeasonLen[x]==300){CTinput2$fluke_bag[5:24] = CTtableHCR$Bag[x]; CTinput2$fluke_min[5:24] = CTtableHCR$MinLen[x]; CTinput2$pd_multiplier[9] <- 5.25; CTinput2$pd_multiplier[20] <- 5}
CTinput2$fluke_bag <- ifelse(is.na(CTinput2$fluke_bag), 0, CTtableHCR$Bag[x])
CTinput2$fluke_min <- ifelse(is.na(CTinput2$fluke_min), 100, CTtableHCR$MinLen[x])
CTinputmiddleman <- na.omit(CTinput2)
if (x==1){CTinputseasonHCRminus10 <- CTinputmiddleman}
if (x==2){CTinputseasonHCRplus10 <- CTinputmiddleman}
if (x==3){CTinputseasonHCRminus20 <- CTinputmiddleman}
if (x==4){CTinputseasonHCRplus20 <- CTinputmiddleman}
if (x==5){CTinputseasonHCRminus40 <- CTinputmiddleman}
if (x==6){CTinputseasonHCRplus40 <- CTinputmiddleman}
if (x==7){CTinputsizeHCRminus10 <- CTinputmiddleman}
if (x==8){CTinputsizeHCRplus10 <- CTinputmiddleman}
if (x==9){CTinputsizeHCRminus20 <- CTinputmiddleman}
if (x==10){CTinputsizeHCRplus20 <- CTinputmiddleman}
if (x==11){CTinputsizeHCRminus40 <- CTinputmiddleman}
if (x==12){CTinputsizeHCRplus40 <- CTinputmiddleman}
if (x==13){CTinputbagHCRminus10 <- CTinputmiddleman}
if (x==14){CTinputbagHCRplus10 <- CTinputmiddleman}
if (x==15){CTinputbagHCRminus20 <- CTinputmiddleman}
if (x==16){CTinputbagHCRplus20 <- CTinputmiddleman}
if (x==17){CTinputbagHCRminus40 <- CTinputmiddleman}
if (x==18){CTinputbagHCRplus40 <- CTinputmiddleman}
}
```
DE
```{r}
DEtableHCR <- CatchTable_NYRegs %>%
filter(State == "DE")
for (x in 1:18){
DEinput2 <- blankinput$DEinput2
if(DEtableHCR$SeasonLen[x]==60){DEinput2$fluke_bag[13:16] = DEtableHCR$Bag[x]; DEinput2$fluke_min[13:16] = DEtableHCR$MinLen[x]} else
if(DEtableHCR$SeasonLen[x]==75){DEinput2$fluke_bag[12:16] = DEtableHCR$Bag[x]; DEinput2$fluke_min[12:16] = DEtableHCR$MinLen[x]} else
if (DEtableHCR$SeasonLen[x]==90){DEinput2$fluke_bag[11:16] = DEtableHCR$Bag[x]; DEinput2$fluke_min[11:16] = DEtableHCR$MinLen[x]} else
if (DEtableHCR$SeasonLen[x]==105){DEinput2$fluke_bag[10:16] = DEtableHCR$Bag[x]; DEinput2$fluke_min[10:16] = DEtableHCR$MinLen[x]} else
if (DEtableHCR$SeasonLen[x]==120){DEinput2$fluke_bag[9:16] = DEtableHCR$Bag[x]; DEinput2$fluke_min[9:16] = DEtableHCR$MinLen[x]} else
if (DEtableHCR$SeasonLen[x]==135){DEinput2$fluke_bag[9:17] = DEtableHCR$Bag[x]; DEinput2$fluke_min[9:17] = DEtableHCR$MinLen[x]} else
if (DEtableHCR$SeasonLen[x]==150){DEinput2$fluke_bag[9:18] = DEtableHCR$Bag[x]; DEinput2$fluke_min[9:18] = DEtableHCR$MinLen[x]} else
if (DEtableHCR$SeasonLen[x]==165){DEinput2$fluke_bag[9:19] = DEtableHCR$Bag[x]; DEinput2$fluke_min[9:19] = DEtableHCR$MinLen[x]} else
if (DEtableHCR$SeasonLen[x]==180){DEinput2$fluke_bag[9:20] = DEtableHCR$Bag[x]; DEinput2$fluke_min[9:20] = DEtableHCR$MinLen[x]} else
if (DEtableHCR$SeasonLen[x]==195){DEinput2$fluke_bag[8:20] = DEtableHCR$Bag[x]; DEinput2$fluke_min[8:20] = DEtableHCR$MinLen[x]} else
if (DEtableHCR$SeasonLen[x]==210){DEinput2$fluke_bag[7:20] = DEtableHCR$Bag[x]; DEinput2$fluke_min[7:20] = DEtableHCR$MinLen[x]} else
if (DEtableHCR$SeasonLen[x]==225){DEinput2$fluke_bag[6:20] = DEtableHCR$Bag[x]; DEinput2$fluke_min[6:20] = DEtableHCR$MinLen[x]} else
if (DEtableHCR$SeasonLen[x]==240){DEinput2$fluke_bag[5:20] = DEtableHCR$Bag[x]; DEinput2$fluke_min[5:20] = DEtableHCR$MinLen[x]; DEinput2$pd_multiplier[6] <- 2} else
if (DEtableHCR$SeasonLen[x]==255){DEinput2$fluke_bag[5:21] = DEtableHCR$Bag[x]; DEinput2$fluke_min[5:21] = DEtableHCR$MinLen[x]; DEinput2$pd_multiplier[6] <- 2} else
if (DEtableHCR$SeasonLen[x]==270){DEinput2$fluke_bag[5:22] = DEtableHCR$Bag[x]; DEinput2$fluke_min[5:22] = DEtableHCR$MinLen[x]; DEinput2$pd_multiplier[6] <- 2; DEinput2$pd_multiplier[21] <- 2} else
if (DEtableHCR$SeasonLen[x]==285){DEinput2$fluke_bag[5:23] = DEtableHCR$Bag[x]; DEinput2$fluke_min[5:23] = DEtableHCR$MinLen[x]; DEinput2$pd_multiplier[6] <- 2; DEinput2$pd_multiplier[21] <- 3} else
if (DEtableHCR$SeasonLen[x]==300){DEinput2$fluke_bag[5:24] = DEtableHCR$Bag[x]; DEinput2$fluke_min[5:24] = DEtableHCR$MinLen[x]; DEinput2$pd_multiplier[6] <- 2; DEinput2$pd_multiplier[21] <- 4}
DEinput2$fluke_bag <- ifelse(is.na(DEinput2$fluke_bag), 0, DEtableHCR$Bag[x])
DEinput2$fluke_min <- ifelse(is.na(DEinput2$fluke_min), 100, DEtableHCR$MinLen[x])
DEinputmiddleman <- na.omit(DEinput2)
if (x==1){DEinputseasonHCRminus10 <- DEinputmiddleman}
if (x==2){DEinputseasonHCRplus10 <- DEinputmiddleman}
if (x==3){DEinputseasonHCRminus20 <- DEinputmiddleman}
if (x==4){DEinputseasonHCRplus20 <- DEinputmiddleman}
if (x==5){DEinputseasonHCRminus40 <- DEinputmiddleman}
if (x==6){DEinputseasonHCRplus40 <- DEinputmiddleman}
if (x==7){DEinputsizeHCRminus10 <- DEinputmiddleman}
if (x==8){DEinputsizeHCRplus10 <- DEinputmiddleman}
if (x==9){DEinputsizeHCRminus20 <- DEinputmiddleman}
if (x==10){DEinputsizeHCRplus20 <- DEinputmiddleman}
if (x==11){DEinputsizeHCRminus40 <- DEinputmiddleman}
if (x==12){DEinputsizeHCRplus40 <- DEinputmiddleman}
if (x==13){DEinputbagHCRminus10 <- DEinputmiddleman}
if (x==14){DEinputbagHCRplus10 <- DEinputmiddleman}
if (x==15){DEinputbagHCRminus20 <- DEinputmiddleman}
if (x==16){DEinputbagHCRplus20 <- DEinputmiddleman}
if (x==17){DEinputbagHCRminus40 <- DEinputmiddleman}
if (x==18){DEinputbagHCRplus40 <- DEinputmiddleman}
}
```
MA
```{r}
MAtableHCR <- CatchTable_NYRegs %>%
filter(State == "MA")
for (x in 1:18){
MAinput2 <- blankinput$MAinput2
if(MAtableHCR$SeasonLen[x]==60){MAinput2$fluke_bag[13:16] = MAtableHCR$Bag[x]; MAinput2$fluke_min[13:16] = MAtableHCR$MinLen[x]} else
if(MAtableHCR$SeasonLen[x]==75){MAinput2$fluke_bag[12:16] = MAtableHCR$Bag[x]; MAinput2$fluke_min[12:16] = MAtableHCR$MinLen[x]} else
if (MAtableHCR$SeasonLen[x]==90){MAinput2$fluke_bag[11:16] = MAtableHCR$Bag[x]; MAinput2$fluke_min[11:16] = MAtableHCR$MinLen[x]} else
if (MAtableHCR$SeasonLen[x]==105){MAinput2$fluke_bag[10:16] = MAtableHCR$Bag[x]; MAinput2$fluke_min[10:16] = MAtableHCR$MinLen[x]; MAinput2$pd_multiplier[10] <- (1/0.563)} else
if (MAtableHCR$SeasonLen[x]==120){MAinput2$fluke_bag[9:16] = MAtableHCR$Bag[x]; MAinput2$fluke_min[9:16] = MAtableHCR$MinLen[x]; MAinput2$pd_multiplier[10] <- 1+(1/0.563)} else
if (MAtableHCR$SeasonLen[x]==135){MAinput2$fluke_bag[9:17] = MAtableHCR$Bag[x]; MAinput2$fluke_min[9:17] = MAtableHCR$MinLen[x]; MAinput2$pd_multiplier[10] <- 1+(1/0.563)} else
if (MAtableHCR$SeasonLen[x]==150){MAinput2$fluke_bag[9:18] = MAtableHCR$Bag[x]; MAinput2$fluke_min[9:18] = MAtableHCR$MinLen[x]; MAinput2$pd_multiplier[10] <- 1+(1/0.563)} else
if (MAtableHCR$SeasonLen[x]==165){MAinput2$fluke_bag[9:19] = MAtableHCR$Bag[x]; MAinput2$fluke_min[9:19] = MAtableHCR$MinLen[x]; MAinput2$pd_multiplier[10] <- 1+(1/0.563)} else
if (MAtableHCR$SeasonLen[x]==180){MAinput2$fluke_bag[9:20] = MAtableHCR$Bag[x]; MAinput2$fluke_min[9:20] = MAtableHCR$MinLen[x]; MAinput2$pd_multiplier[10] <- 1+(1/0.563)} else
if (MAtableHCR$SeasonLen[x]==195){MAinput2$fluke_bag[8:20] = MAtableHCR$Bag[x]; MAinput2$fluke_min[8:20] = MAtableHCR$MinLen[x]; MAinput2$pd_multiplier[10] <- 2+(1/0.563)} else
if (MAtableHCR$SeasonLen[x]==210){MAinput2$fluke_bag[7:20] = MAtableHCR$Bag[x]; MAinput2$fluke_min[7:20] = MAtableHCR$MinLen[x]; MAinput2$pd_multiplier[10] <- 3+(1/0.563)} else
if (MAtableHCR$SeasonLen[x]==225){MAinput2$fluke_bag[6:20] = MAtableHCR$Bag[x]; MAinput2$fluke_min[6:20] = MAtableHCR$MinLen[x]; MAinput2$pd_multiplier[10] <- 4+(1/0.563)} else
if (MAtableHCR$SeasonLen[x]==240){MAinput2$fluke_bag[5:20] = MAtableHCR$Bag[x]; MAinput2$fluke_min[5:20] = MAtableHCR$MinLen[x]; MAinput2$pd_multiplier[10] <- 5+(1/0.563)} else
if (MAtableHCR$SeasonLen[x]==255){MAinput2$fluke_bag[5:21] = MAtableHCR$Bag[x]; MAinput2$fluke_min[5:21] = MAtableHCR$MinLen[x]; MAinput2$pd_multiplier[10] <- 5+(1/0.563); MAinput2$pd_multiplier[20] <- 2} else
if (MAtableHCR$SeasonLen[x]==270){MAinput2$fluke_bag[5:22] = MAtableHCR$Bag[x]; MAinput2$fluke_min[5:22] = MAtableHCR$MinLen[x]; MAinput2$pd_multiplier[10] <- 5+(1/0.563); MAinput2$pd_multiplier[20] <- 3} else
if (MAtableHCR$SeasonLen[x]==285){MAinput2$fluke_bag[5:23] = MAtableHCR$Bag[x]; MAinput2$fluke_min[5:23] = MAtableHCR$MinLen[x]; MAinput2$pd_multiplier[10] <- 5+(1/0.563); MAinput2$pd_multiplier[20] <- 4} else
if (MAtableHCR$SeasonLen[x]==300){MAinput2$fluke_bag[5:24] = MAtableHCR$Bag[x]; MAinput2$fluke_min[5:24] = MAtableHCR$MinLen[x]; MAinput2$pd_multiplier[10] <- 5+(1/0.563); MAinput2$pd_multiplier[20] <- 5}
MAinput2$fluke_bag <- ifelse(is.na(MAinput2$fluke_bag), 0, MAtableHCR$Bag[x])
MAinput2$fluke_min <- ifelse(is.na(MAinput2$fluke_min), 100, MAtableHCR$MinLen[x])
if (MAinput2$fluke_bag[19]!=0){MAinput2$pd_multiplier[19] <- (1/0.6)}
MAinputmiddleman <- na.omit(MAinput2)
if (x==1){MAinputseasonHCRminus10 <- MAinputmiddleman}
if (x==2){MAinputseasonHCRplus10 <- MAinputmiddleman}
if (x==3){MAinputseasonHCRminus20 <- MAinputmiddleman}
if (x==4){MAinputseasonHCRplus20 <- MAinputmiddleman}
if (x==5){MAinputseasonHCRminus40 <- MAinputmiddleman}
if (x==6){MAinputseasonHCRplus40 <- MAinputmiddleman}
if (x==7){MAinputsizeHCRminus10 <- MAinputmiddleman}
if (x==8){MAinputsizeHCRplus10 <- MAinputmiddleman}
if (x==9){MAinputsizeHCRminus20 <- MAinputmiddleman}
if (x==10){MAinputsizeHCRplus20 <- MAinputmiddleman}
if (x==11){MAinputsizeHCRminus40 <- MAinputmiddleman}
if (x==12){MAinputsizeHCRplus40 <- MAinputmiddleman}
if (x==13){MAinputbagHCRminus10 <- MAinputmiddleman}
if (x==14){MAinputbagHCRplus10 <- MAinputmiddleman}
if (x==15){MAinputbagHCRminus20 <- MAinputmiddleman}
if (x==16){MAinputbagHCRplus20 <- MAinputmiddleman}
if (x==17){MAinputbagHCRminus40 <- MAinputmiddleman}
if (x==18){MAinputbagHCRplus40 <- MAinputmiddleman}
}
```
Aggregate
```{r}
HCRminus10season <- rbind(CTinputseasonHCRminus10, DEinputseasonHCRminus10, MAinputseasonHCRminus10, MDinputseasonHCRminus10, NCinputseasonHCRminus10, NJinputseasonHCRminus10, NYinputseasonHCRminus10, RIinputseasonHCRminus10, VAinputseasonHCRminus10)
HCRminus10size <- rbind(CTinputsizeHCRminus10, DEinputsizeHCRminus10, MAinputsizeHCRminus10, MDinputsizeHCRminus10, NCinputsizeHCRminus10, NJinputsizeHCRminus10, NYinputsizeHCRminus10, RIinputsizeHCRminus10, VAinputsizeHCRminus10)
HCRminus10bag <- rbind(CTinputbagHCRminus10, DEinputbagHCRminus10, MAinputbagHCRminus10, MDinputbagHCRminus10, NCinputbagHCRminus10, NJinputbagHCRminus10, NYinputbagHCRminus10, RIinputbagHCRminus10, VAinputbagHCRminus10)
HCRplus10season <- rbind(CTinputseasonHCRplus10, DEinputseasonHCRplus10, MAinputseasonHCRplus10, MDinputseasonHCRplus10, NCinputseasonHCRplus10, NJinputseasonHCRplus10, NYinputseasonHCRplus10, RIinputseasonHCRplus10, VAinputseasonHCRplus10)
HCRplus10size <- rbind(CTinputsizeHCRplus10, DEinputsizeHCRplus10, MAinputsizeHCRplus10, MDinputsizeHCRplus10, NCinputsizeHCRplus10, NJinputsizeHCRplus10, NYinputsizeHCRplus10, RIinputsizeHCRplus10, VAinputsizeHCRplus10)
HCRplus10bag <- rbind(CTinputbagHCRplus10, DEinputbagHCRplus10, MAinputbagHCRplus10, MDinputbagHCRplus10, NCinputbagHCRplus10, NJinputbagHCRplus10, NYinputbagHCRplus10, RIinputbagHCRplus10, VAinputbagHCRplus10)
HCRminus20season <- rbind(CTinputseasonHCRminus20, DEinputseasonHCRminus20, MAinputseasonHCRminus20, MDinputseasonHCRminus20, NCinputseasonHCRminus20, NJinputseasonHCRminus20, NYinputseasonHCRminus20, RIinputseasonHCRminus20, VAinputseasonHCRminus20)
HCRminus20size <- rbind(CTinputsizeHCRminus20, DEinputsizeHCRminus20, MAinputsizeHCRminus20, MDinputsizeHCRminus20, NCinputsizeHCRminus20, NJinputsizeHCRminus20, NYinputsizeHCRminus20, RIinputsizeHCRminus20, VAinputsizeHCRminus20)
HCRminus20bag <- rbind(CTinputbagHCRminus20, DEinputbagHCRminus20, MAinputbagHCRminus20, MDinputbagHCRminus20, NCinputbagHCRminus20, NJinputbagHCRminus20, NYinputbagHCRminus20, RIinputbagHCRminus20, VAinputbagHCRminus20)
HCRplus20season <- rbind(CTinputseasonHCRplus20, DEinputseasonHCRplus20, MAinputseasonHCRplus20, MDinputseasonHCRplus20, NCinputseasonHCRplus20, NJinputseasonHCRplus20, NYinputseasonHCRplus20, RIinputseasonHCRplus20, VAinputseasonHCRplus20)
HCRplus20size <- rbind(CTinputsizeHCRplus20, DEinputsizeHCRplus20, MAinputsizeHCRplus20, MDinputsizeHCRplus20, NCinputsizeHCRplus20, NJinputsizeHCRplus20, NYinputsizeHCRplus20, RIinputsizeHCRplus20, VAinputsizeHCRplus20)
HCRplus20bag <- rbind(CTinputbagHCRplus20, DEinputbagHCRplus20, MAinputbagHCRplus20, MDinputbagHCRplus20, NCinputbagHCRplus20, NJinputbagHCRplus20, NYinputbagHCRplus20, RIinputbagHCRplus20, VAinputbagHCRplus20)
HCRminus40season <- rbind(CTinputseasonHCRminus40, DEinputseasonHCRminus40, MAinputseasonHCRminus40, MDinputseasonHCRminus40, NCinputseasonHCRminus40, NJinputseasonHCRminus40, NYinputseasonHCRminus40, RIinputseasonHCRminus40, VAinputseasonHCRminus40)
HCRminus40size <- rbind(CTinputsizeHCRminus40, DEinputsizeHCRminus40, MAinputsizeHCRminus40, MDinputsizeHCRminus40, NCinputsizeHCRminus40, NJinputsizeHCRminus40, NYinputsizeHCRminus40, RIinputsizeHCRminus40, VAinputsizeHCRminus40)
HCRminus40bag <- rbind(CTinputbagHCRminus40, DEinputbagHCRminus40, MAinputbagHCRminus40, MDinputbagHCRminus40, NCinputbagHCRminus40, NJinputbagHCRminus40, NYinputbagHCRminus40, RIinputbagHCRminus40, VAinputbagHCRminus40)
HCRplus40season <- rbind(CTinputseasonHCRplus40, DEinputseasonHCRplus40, MAinputseasonHCRplus40, MDinputseasonHCRplus40, NCinputseasonHCRplus40, NJinputseasonHCRplus40, NYinputseasonHCRplus40, RIinputseasonHCRplus40, VAinputseasonHCRplus40)
HCRplus40size <- rbind(CTinputsizeHCRplus40, DEinputsizeHCRplus40, MAinputsizeHCRplus40, MDinputsizeHCRplus40, NCinputsizeHCRplus40, NJinputsizeHCRplus40, NYinputsizeHCRplus40, RIinputsizeHCRplus40, VAinputsizeHCRplus40)
HCRplus40bag <- rbind(CTinputbagHCRplus40, DEinputbagHCRplus40, MAinputbagHCRplus40, MDinputbagHCRplus40, NCinputbagHCRplus40, NJinputbagHCRplus40, NYinputbagHCRplus40, RIinputbagHCRplus40, VAinputbagHCRplus40)
pd_multiply_allregulations_input_HCRgrouping_regdistinct <- list(
"-10% : Season" = HCRminus10season,
"-10% : Length" = HCRminus10size,
"-10% : Bag" = HCRminus10bag,
"+10% : Season" = HCRplus10season,
"+10% : Length" = HCRplus10size,
"+10% : Bag" = HCRplus10bag,
"-20% : Season" = HCRminus20season,
"-20% : Length" = HCRminus20size,
"-20% : Bag" = HCRminus20bag,
"+20% : Season" = HCRplus20season,
"+20% : Length" = HCRplus20size,
"+20% : Bag" = HCRplus20bag,
"-40% : Season" = HCRminus40season,
"-40% : Length" = HCRminus40size,
"-40% : Bag" = HCRminus40bag,
"+40% : Season" = HCRplus40season,
"+40% : Length" = HCRplus40size,
"+40% : Bag" = HCRplus40bag
)
```
```{r}
saveRDS(pd_multiply_allregulations_input_HCRgrouping_regdistinct, file = "frac_pdmultiplied_allregulations_input_HCRgrouping_regdistinct.rds")
readRDS("frac_pdmultiplied_allregulations_input_HCRgrouping_regdistinct.rds")
```