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

ww_multi_scale() should give friendlier errors when arguments are missing #46

Open
mikemahoney218 opened this issue Jun 14, 2023 · 0 comments

Comments

@mikemahoney218
Copy link
Member

waywiser::ww_multi_scale(waywiser::ny_trees, n = 2)
#> Error in `data[[truth_var]]` at waywiser/R/multi_scale.R:383:2:
#> ! Can't extract column with `truth_var`.
#> ✖ Subscript `truth_var` must be size 1, not 0.
#> Backtrace:
#>      ▆
#>   1. ├─waywiser::ww_multi_scale(waywiser::ny_trees, n = 2)
#>   2. └─waywiser:::ww_multi_scale.sf(waywiser::ny_trees, n = 2) at waywiser/R/multi_scale.R:158:4
#>   3.   ├─data[[truth_var]] at waywiser/R/multi_scale.R:383:2
#>   4.   └─tibble:::`[[.tbl_df`(data, truth_var) at waywiser/R/multi_scale.R:383:2
#>   5.     └─tibble:::tbl_subset2(x, j = i, j_arg = substitute(i))
#>   6.       └─tibble:::vectbl_as_col_location2(...)
#>   7.         ├─tibble:::subclass_col_index_errors(...)
#>   8.         │ └─base::withCallingHandlers(...)
#>   9.         └─vctrs::vec_as_location2(j, n, names, call = call)
#>  10.           └─vctrs:::result_get(...)
#>  11.             └─rlang::cnd_signal(x$err)
waywiser::ww_multi_scale(waywiser::ny_trees, agb, n = 2)
#> Error in `data[[estimate_var]]` at waywiser/R/multi_scale.R:387:2:
#> ! Can't extract column with `estimate_var`.
#> ✖ Subscript `estimate_var` must be size 1, not 0.
#> Backtrace:
#>      ▆
#>   1. ├─waywiser::ww_multi_scale(waywiser::ny_trees, agb, n = 2)
#>   2. └─waywiser:::ww_multi_scale.sf(waywiser::ny_trees, agb, n = 2) at waywiser/R/multi_scale.R:158:4
#>   3.   ├─data[[estimate_var]] at waywiser/R/multi_scale.R:387:2
#>   4.   └─tibble:::`[[.tbl_df`(data, estimate_var) at waywiser/R/multi_scale.R:387:2
#>   5.     └─tibble:::tbl_subset2(x, j = i, j_arg = substitute(i))
#>   6.       └─tibble:::vectbl_as_col_location2(...)
#>   7.         ├─tibble:::subclass_col_index_errors(...)
#>   8.         │ └─base::withCallingHandlers(...)
#>   9.         └─vctrs::vec_as_location2(j, n, names, call = call)
#>  10.           └─vctrs:::result_get(...)
#>  11.             └─rlang::cnd_signal(x$err)

Created on 2023-06-14 with reprex v2.0.2

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