-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathoutput.R
More file actions
51 lines (37 loc) · 1.05 KB
/
output.R
File metadata and controls
51 lines (37 loc) · 1.05 KB
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
## Extract results of interest, write TAF output tables
## Before:
## After: csv tables of assessment output
library(icesTAF)
library(stockassessment)
library(FLfse)
mkdir("output")
# load fit
load("model/fit.rData", verbose = TRUE)
# Model Parameters
partab <- partable(fit)
# Fs
fatage <- faytable(fit)
fatage <- fatage[, -1]
fatage <- as.data.frame(fatage)
# Ns
natage <- as.data.frame(ntable(fit))
# Catch
catab <- as.data.frame(catchtable(fit))
colnames(catab) <- c("Catch", "Low", "High")
# TSB
tsb <- as.data.frame(tsbtable(fit))
colnames(tsb) <- c("TSB", "Low", "High")
# Summary Table
tab.summary <- cbind(as.data.frame(summary(fit)), tsb)
tab.summary <- cbind(tab.summary, catab)
# should probably make Low and High column names unique R_Low etc.
mohns_rho <- mohn(retro_fit)
mohns_rho <- as.data.frame(t(mohns_rho))
## Write tables to output directory
write.taf(
c("partab", "tab.summary", "natage", "fatage", "mohns_rho"),
dir = "output"
)
stock <- FLfse::SAM2FLStock(fit)
save(stock, file = "output/FLStock.Rdata")
# ADD catch options upload