Closed Blevy2 closed 2 years ago
Hi Ben,
Thanks for picking this up, yes I vaguely recall this issue when I was extracting the results from my analysis. Definitely better the way round you suggest, so I'll correct.
Cheers, Paul
On Mon, 3 Jan 2022, 13:41 Blevy2, @.***> wrote:
Hi @pdolder https://github.com/pdolder ,
I think there is a small bug in the way that the spatial population values are saved at the end of run_sim https://github.com/pdolder/MixFishSim/blob/f4be072ef8328845a635e68d69a290be4b944fa5/R/run_sim.R#L592 .
pop_bios has size (# years) x (weeks per year). Each entry of pop_bios is a list that contains the spatial population values for each species. at the end of run_sim https://github.com/pdolder/MixFishSim/blob/f4be072ef8328845a635e68d69a290be4b944fa5/R/run_sim.R#L592 when you write pop_bios = pop_bios, the entries are recorded as a list by columns, where I believe it should be by rows. As a result the output in res[["pop_bios"]] is grouped by week rather than by year. That is, week 1 output for all years is recorded in order followed by week 2 output for all years and so on. What we really want is all of year 1 output to be recorded in order followed by all of year 2 output and so on.
Although it took me a while to figure out what the problem was, I believe it is an easy fix at the end of run_sim https://github.com/pdolder/MixFishSim/blob/f4be072ef8328845a635e68d69a290be4b944fa5/R/run_sim.R#L592 by changing pop_bios = pop_bios to pop_bios = t(pop_bios).
That way when the objects are saved by column they will be in the correct order.
best,
Ben Levy
— Reply to this email directly, view it on GitHub https://github.com/pdolder/MixFishSim/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC4F4SKOLBAQE5RP3HPCTKDUUHUWBANCNFSM5LFYY5QA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you were mentioned.Message ID: @.***>
Change accepted.
Hi @pdolder ,
I think there is a small bug in the way that the spatial population values are saved at the end of run_sim.
pop_bios has size (# years) x (weeks per year). Each entry of pop_bios is a list that contains the spatial population values for each species. at the end of run_sim when you write pop_bios = pop_bios, the entries are recorded as a list by columns, where I believe it should be by rows. As a result the output in res[["pop_bios"]] is grouped by week rather than by year. That is, week 1 output for all years is recorded in order followed by week 2 output for all years and so on. What we really want is all of year 1 output to be recorded in order followed by all of year 2 output and so on.
Although it took me a while to figure out what the problem was, I believe it is an easy fix at the end of run_sim by changing pop_bios = pop_bios to pop_bios = t(pop_bios).
That way when the objects are saved by column they will be in the correct order.
best,
Ben Levy