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

hydroweight_attributes for numeric variables stalls with str_extract issue #18

Open
mccaigml opened this issue Jan 11, 2024 · 0 comments

Comments

@mccaigml
Copy link

Running hydroweight_attributes with a numeric loi throws this error

Error in stringr::str_replace():
! Can't recycle string (size 30) to match pattern (size 3).
Run rlang::last_trace() to see where the error occurred.

Error is from lines 181-183. @Smendero and I were able to introduce a quick fix (but not generalizable) by using str_c(loi_columns, "|") - but this solution is not ideal or generalizable as it requires our loi columns are in the correct order if they contain similar text.

e.g., c("Defo", "Defo_weighted") needs to be arranged c("Defo_weighted", "Defo") or else only "Defo" will be extracted from all column names.

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