{"action":"created","issue":{"url":"https://api.github.com/repos/r4ss/r4ss/issues/79","labels_url":"https://api.github.com/repos/r4ss/r4ss/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/r4ss/r4ss/issues/79/comments","events_url":"https://api.github.com/repos/r4ss/r4ss/issues/79/events","html_url":"https://github.com/r4ss/r4ss/issues/79","id":116260763,"number":79,"title":"Print informative SS_plots output to HTML home page","user":{"login":"colemonnahan","id":4804974,"avatar_url":"https://avatars.githubusercontent.com/u/4804974?v=3","gravatar_id":"","url":"https://api.github.com/users/colemonnahan","html_url":"https://github.com/colemonnahan","followers_url":"https://api.github.com/users/colemonnahan/followers","following_url":"https://api.github.com/users/colemonnahan/following{/other_user}","gists_url":"https://api.github.com/users/colemonnahan/gists{/gist_id}","starred_url":"https://api.github.com/users/colemonnahan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colemonnahan/subscriptions","organizations_url":"https://api.github.com/users/colemonnahan/orgs","repos_url":"https://api.github.com/users/colemonnahan/repos","events_url":"https://api.github.com/users/colemonnahan/events{/privacy}","received_events_url":"https://api.github.com/users/colemonnahan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-11T04:09:26Z","updated_at":"2015-11-12T17:13:34Z","closed_at":null,"body":"Ian Stewart had the good idea to save the console output created by `SS_plots` and also include it on the HTML home page. A lot of this output is only useful for debugging, but some of it, such as the Francis weights output, bias adjustment values, and warnings. Since some of this text is in subfunctions (e.g., `SSplotBiology`) it would require changing quite a bit of the code, at least small bits across many files. I thought it'd be worth a discussion about how to approach this (or if we should) before I dove in and started tinkering around too much.\r\n\r\nMy first thought is to define a new `cat` function that serves two purposes: (1) prints to screen as before and (2) saves what is being printed to an object.\r\n\r\nSomething like this:\r\n\r\n````\r\ncat2 <- function(..., file){\r\n    cat(...)\r\n    c(file, ...)\r\n}\r\nfile <- NULL\r\nfile <- cat2('test1\\n', 'test2\\n', file=file)\r\nfile <- cat2('test3\\n and testing again\\n', file=file)\r\nfile <- cat2(1:4, file=file)\r\nfile\r\ncat(file)\r\n````\r\n\r\nI guess we'd either have to use a global variable or pass `file` along (not a good solution). @taylori and @allanhicks do you have any ideas/thoughts about this approach? "},"comment":{"url":"https://api.github.com/repos/r4ss/r4ss/issues/comments/156170058","html_url":"https://github.com/r4ss/r4ss/issues/79#issuecomment-156170058","issue_url":"https://api.github.com/repos/r4ss/r4ss/issues/79","id":156170058,"user":{"login":"colemonnahan","id":4804974,"avatar_url":"https://avatars.githubusercontent.com/u/4804974?v=3","gravatar_id":"","url":"https://api.github.com/users/colemonnahan","html_url":"https://github.com/colemonnahan","followers_url":"https://api.github.com/users/colemonnahan/followers","following_url":"https://api.github.com/users/colemonnahan/following{/other_user}","gists_url":"https://api.github.com/users/colemonnahan/gists{/gist_id}","starred_url":"https://api.github.com/users/colemonnahan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colemonnahan/subscriptions","organizations_url":"https://api.github.com/users/colemonnahan/orgs","repos_url":"https://api.github.com/users/colemonnahan/repos","events_url":"https://api.github.com/users/colemonnahan/events{/privacy}","received_events_url":"https://api.github.com/users/colemonnahan/received_events","type":"User","site_admin":false},"created_at":"2015-11-12T17:13:34Z","updated_at":"2015-11-12T17:13:34Z","body":"I've always used `message` as well but more out of habit than preference over `cat`. Each seems to have slight advantages. I'm not big on knitr to be honest, so I don't think any big changes to accommodate it are high priority (why not just run a script and use LaTeX?). How many people are using it?\r\n\r\nThis issue is something Ian Stewart has for me as a lower priority so maybe I'll get to it in a few weeks.\r\n\r\nThe tricky part is that the messages are spread through the subfunctions but also in `SS_plots`. So if we do something like I proposed above, and use a global variable, it'll get messy keeping track of that when people are running subfunctions separately and repeatedly.  I guess we could just ignore that global variable except in the `SS_html` function, initiating it as NULL at the top of `SS_plots`. Still, I think the bookkeeping would be kind of annoying. I'll keep thinking of alternatives."}}