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

PEC_sw_drift not vectorized #2

Open
juklei opened this issue Sep 4, 2024 · 1 comment
Open

PEC_sw_drift not vectorized #2

juklei opened this issue Sep 4, 2024 · 1 comment

Comments

@juklei
Copy link

juklei commented Sep 4, 2024

Hi Hannes.

Another thing on Julian's wishlist:-)

The function is not vectorized if the user wants to supply the function with crop groups. The application of PEC_sw_drift() to a large data set via apply becomes computationally very time consuming. If crop group is not supplied, the function is vectorized.

I assume the vectorisation can be made possible by changing

crop_group_RF <- match.arg(crop_group_RF)

to

crop_group_RF <- sapply(crop_group_RF, match.arg)

But further changes migth be necessary...

@jranke
Copy link
Owner

jranke commented Sep 6, 2024

Hi Julian, unfortunately this does not work, I get test failures with this proposed change.

It seems we would need some other way to check the validity of the argument(s) for crop_group_JKI and crop_group_RF if we want to vectorize.

Cheers, Hannes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants