on RACMS

Preamble

I must say that I am not quite sure what is being asked from me when I read through Doc12. So rather than directly comment to the document/table provided I thought it may be of help to describe my current workflow. With the idea of providing some thinking for the RACMS-gang with respect to how such a workflow may be accommodated with the system that is in development. Mind you, I fully agree with the basic philosophy that seems to behind the concept.

I work in an environment that goes under different names, but we can call it here reproducible analysis and document writing. In my case I write, analyse, create tables and figures all in one single environment RStudio. A case in point is the document you are reading. Within this environment one can create documents in various formats, depending on the desired output. Besides operating in a simple text editor (similar to wordpad) one can generate text in R-markdown if the final output is going to be an html-document or R-weave if the final output is going to be a latex-style pdf document. Style for creating output as html-format slides is also recently been made available. Disclaimer: RStudio is not the only IDE environment available out there.

Now the neat thing with these types of environments is that R-codes (franca-lingua of stock assessment analysis) can be embedded inside the document. And that includes besides R-analysis, codes to the system (for example running some admb-code), table generation of any results as well figures are embedded within one single document. Having R as the platform opens of course then all the other aspects that are embedded in that environment. Including pulling/downloading data, objects, etc. from the web, work on it and then and push/upload some results, like resulting stock summary results anywhere to the web. Where allowed. Nota bene without leaving the environment at all.

On top of this git version control (a true olympian track-changes feature for social documents and programming generation) are an integrated part of RStudio, but I will leave for now saying any more on that. Instead I will make a little demo, to demonstrate how one can pull data from the web.

The R-code is displayed in the document that you are reading. This feature can easily be turned-off using a single switch. So that one would only see the table and the figure.

A little demo

I must say that I have not fully explored the syntax capabilities of the R-markdown environment, been more operating in the R-weave (latex pdf-generator). But here I take a text file from a (my) git*hub site, a file that is part of a non-official **fishvise*-Rpackage (just a trash can of various stuff for now) and “print” and plot some stuff as a part of this html-document.

library(RCurl)
## Loading required package: bitops
x <- getURL("https://raw.github.com/einarhjorleifsson/fishvise/master/inst/extdata/resultsbyyear")
rby <- read.table(text = x, header = TRUE)
rby <- rby[rby$year <= 2013, c("year", "N3", "SSB", "Cbio4.", "obscatch", "F5.10")]
names(rby) <- c("year", "rec", "ssb", "bio", "yield", "Fbar")
print(rby)
##    year    rec   ssb    bio yield   Fbar
## 1  1955 152001 935.9 2354.1 545.2 0.2909
## 2  1956 152836 790.5 2079.1 486.9 0.2905
## 3  1957 170654 771.0 1876.2 455.2 0.3113
## 4  1958 220617 871.6 1863.5 517.4 0.3546
## 5  1959 288999 851.0 1826.6 459.1 0.3219
## 6  1960 154372 707.7 1752.5 470.1 0.3714
## 7  1961 192798 466.6 1495.5 377.3 0.3553
## 8  1962 128900 568.1 1491.5 389.0 0.3827
## 9  1963 177516 507.1 1314.8 408.8 0.4577
## 10 1964 204212 450.5 1218.3 437.0 0.5481
## 11 1965 216428 317.4 1022.4 387.1 0.5757
## 12 1966 229187 277.0 1031.3 353.4 0.5888
## 13 1967 320150 256.3 1102.7 335.7 0.5604
## 14 1968 172017 221.5 1222.6 381.8 0.7207
## 15 1969 247560 313.6 1325.5 403.2 0.5577
## 16 1970 180561 331.0 1336.9 475.1 0.6115
## 17 1971 188685 242.4 1097.9 444.2 0.6844
## 18 1972 139340 221.6  996.8 395.2 0.6937
## 19 1973 273095 245.3  843.8 369.2 0.7046
## 20 1974 179021 187.0  918.2 368.1 0.7637
## 21 1975 260789 168.3  895.3 364.8 0.8097
## 22 1976 367246 138.5  955.4 346.3 0.7473
## 23 1977 143318 198.6 1289.0 340.1 0.5924
## 24 1978 227712 212.3 1297.1 329.6 0.4763
## 25 1979 243218 304.0 1396.7 366.5 0.4457
## 26 1980 139964 356.7 1489.4 432.2 0.4921
## 27 1981 140372 264.0 1241.7 465.0 0.6626
## 28 1982 131730 167.2  970.2 380.1 0.7294
## 29 1983 233035 130.1  790.9 298.0 0.7140
## 30 1984 139055 141.0  913.4 282.0 0.6400
## 31 1985 140192 172.4  927.4 323.4 0.6678
## 32 1986 329016 197.9  854.3 364.8 0.7736
## 33 1987 260017 149.5 1029.3 389.9 0.8617
## 34 1988 175490 171.6 1030.5 377.6 0.8922
## 35 1989  89208 171.1 1001.1 363.1 0.7189
## 36 1990 130530 213.5  841.1 335.3 0.7005
## 37 1991 106830 160.5  698.3 307.8 0.8008
## 38 1992 174254 152.6  550.6 264.8 0.8455
## 39 1993 135533 124.3  594.9 250.7 0.8689
## 40 1994  77702 154.0  576.0 178.1 0.6259
## 41 1995 151007 179.0  556.9 168.6 0.5084
## 42 1996 165525 159.4  670.3 180.7 0.5060
## 43 1997  88262 190.0  782.8 203.1 0.5446
## 44 1998 161493 211.5  720.5 244.0 0.6518
## 45 1999  70848 184.6  731.0 260.1 0.7447
## 46 2000 171826 167.0  590.2 235.1 0.7609
## 47 2001 161591 161.9  688.1 234.2 0.7465
## 48 2002 159207 197.2  729.1 208.5 0.6281
## 49 2003 178414 186.6  740.0 207.5 0.5777
## 50 2004  79980 202.4  800.0 226.8 0.5810
## 51 2005 154828 231.7  722.7 213.4 0.5483
## 52 2006 134691 221.3  699.7 196.1 0.5417
## 53 2007  95010 203.9  679.8 170.3 0.5091
## 54 2008 135063 268.2  700.8 146.1 0.3876
## 55 2009 122497 253.5  798.1 181.2 0.3801
## 56 2010 129026 302.1  846.7 168.9 0.3269
## 57 2011 169290 368.6  938.0 170.4 0.2810
## 58 2012 174934 423.1 1054.4 194.8 0.2843
## 59 2013 118966 479.1 1172.7  -1.0 0.2577

Footnote: I am not well versed in the R-markdown format, but I know that the table above can be generated in a much nicer format.

Now instead of printing, I could imagine that the stock-summary data were based of course on real analysis (i.e. not downloaded from some web-page and mangled a bit) and then that uploaded in an ICES-specified format on ICES-specified repository. Which could then an integral of RACMS-system. So instead of the 'print(rby)' one would do something like 'push(rby, site=“secreteGeheimnishAtICES”, stock_name = “cod-iceg”)'.

In the meantime I would just proceed with creating my informative version of the stock summary plot in the EG-report:

rby$hr <- rby$yield/rby$bio
rby <- melt(rby, "year")
ggplot(rby, aes(year, value)) + geom_line() + facet_wrap(~variable, scale = "free_y") + 
    labs(x = "", y = "")

plot of chunk unnamed-chunk-2

Bottom line

Behind the RACMS interface lies a complicated computer code. Code that likely (??) will involve the complicated copy-paste-procedures - and instructions/manuals. I can even think of needs for myriad physical meetings equivalent to the inter-catch-courses. Ensuring that simplicity such as dictaded above is also accommodated should really not really involve a lot of code. Just some clear specifications on format and ices-repository instructions.

regards,

einar