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 vectors #68

Merged
merged 4 commits into from
Dec 4, 2024
Merged

Adjust vectors #68

merged 4 commits into from
Dec 4, 2024

Conversation

slucey
Copy link
Member

@slucey slucey commented Sep 27, 2023

Minor fix to allow adjust.scenario to work on a vector of groups rather than one at a time.

This was referenced Sep 27, 2023
@slucey slucey requested a review from kaydin September 27, 2023 18:21
@slucey slucey linked an issue Sep 27, 2023 that may be closed by this pull request
@kaydin kaydin merged commit 2f2d993 into dev Dec 4, 2024
7 checks passed
@kaydin
Copy link
Collaborator

kaydin commented Dec 4, 2024

Works with following test script. Note that "groupto" can only be a single group (not a vector) so this can be applied across multiple prey for a single predator, but not across multiple predators.

`library(Rpath)

unbal <- REco.params
bal <- rpath(unbal)

scene0 <- rsim.scenario(bal,unbal,1:100)
scene1 <- adjust.scenario(scene0, parameter="MzeroMort", group="Seabirds", value=5 )
scene2 <- adjust.scenario(scene0, parameter="MzeroMort", group=c("Seabirds","Whales","Seals"), value=c(2,3,4))
scene3 <- adjust.scenario(scene0, parameter="MzeroMort", group="all", value=3)

scene1$params$MzeroMort
scene2$params$MzeroMort
scene3$params$MzeroMort

scene4 <- adjust.scenario(scene0, parameter="VV", group="OtherForagefish", groupto="Seabirds", value=5 )
scene5 <- adjust.scenario(scene0, parameter="VV", group="OtherForagefish", groupto="Zooplankton", value=5 )
scene6 <- adjust.scenario(scene0, parameter="VV", group="all", groupto="Seabirds", value=5 )
scene7 <- adjust.scenario(scene0, parameter="VV", group=c("OtherForagefish","Discards","JuvRoundfish1","JuvRoundfish2"),
groupto="Seabirds", value=c(1,5) )

scene4$params$VV
scene5$params$VV
scene6$params$VV
scene7$params$VV`

@kaydin kaydin deleted the adjust_vectors branch December 4, 2024 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adjust.scenario for multiple groups
2 participants