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

Inconsistency between landWStock and landWStock.f (possibly also others) #59

Open
pdolder opened this issue Sep 10, 2021 · 0 comments
Open

Comments

@pdolder
Copy link
Member

pdolder commented Sep 10, 2021

Hi,

In landWStock the code ensures that and NAs do not lead to problems by converting NAs to zeros here:

resf <- m@catches[[stock]]@landings.n * m@catches[[stock]]@landings.wt
resf[is.na(resf)] <- 0
res <- res + resf

However, this is not done in landWStock.f where they are added directly:

res <- res + m@catches[[stock]]@landings.n * m@catches[[stock]]@landings.wt
res[is.na(res)] <- 0

This causes a problem with NAs in 'm', where you get NAs in res removing the values already there.

I think this should be exactly as in landWStock to work correctly ?

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

No branches or pull requests

1 participant