Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust.scenario for multiple groups #21

Open
slucey opened this issue Jan 22, 2021 · 1 comment · May be fixed by #68
Open

Adjust.scenario for multiple groups #21

slucey opened this issue Jan 22, 2021 · 1 comment · May be fixed by #68
Assignees
Labels
bug Something isn't working
Milestone

Comments

@slucey
Copy link
Member

slucey commented Jan 22, 2021

Dear Sean,

I hope you are doing well and that this email finds you healthy.

Since I started using Rpath I was wondering if there is a way such that modifications of an Rsim scenario could be streamline as one could do with Rpath model through the read.rpath.params() function that then you could run rpath.stanzas() and later rpath() and with that you have a working Rpath model. With Rsim however it is not possible (or at least I do not know how) to streamline the process of forcing the functions. For instance, when adjusting the scenario for vulnerabilities one needs to do this:

Rsim.model <- adjust.scenario(Rsim.model, parameter = "VV",
                              group = "AdHerring", groupto = "AdCod",
                              value = 1)

Rsim.model <- adjust.scenario(Rsim.model, parameter = "VV",
                              group = "JuvSprat", groupto = "AdCod",
                              value = 2.054679E+08)

Rsim.model <- adjust.scenario(Rsim.model, parameter = "VV",
                              group = "AdSprat", groupto = "AdCod",
                              value = 17.36081)

Rather than something like this:

Rsim.model <- adjust.scenario(Rsim.model, parameter = "VV",
                              group = c("AdHerring", "JuvSprat", "AdSprat"),
                              groupto = "AdCod",
                              value = c(1, 2.054679E+08, 17.36081))

In the release notes of v0.0.1.2 it reads that now “adjust.scenario can be applied to multiple groups at once rather than one at a time.” The thing though is that from logical R programming one would do what I did above but it is not working. Perhaps because Rpath uses data.table at its core, maybe I need to use a special data.table command to pass to adjust.scenario(). VV is a vector though from what I recall in rpath rather than a matrix as in EwE and the way is populated is special with the outside and primary producers as the first two elements of this vector. It seems that this outside group repeats when checked through Rsim.model$params$PreyFrom . Do you have any suggestions as to how pass multiple groups and values at once in the adjust.scenario() function??

Thank you very much in advance as always.

All the absolute best,

Thomas.

@slucey slucey added the bug Something isn't working label Jan 22, 2021
@slucey
Copy link
Member Author

slucey commented Sep 27, 2023

This is being addressed by pull request #68

@slucey slucey linked a pull request Sep 27, 2023 that will close this issue
@slucey slucey added this to the Version 0.1.5 milestone Sep 27, 2023
@slucey slucey self-assigned this Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant