pointblank
pointblank copied to clipboard
Fail gracefully when calling info_columns when column doesn't exist
Prework
- [x] Read and abide by pointblank's code of conduct and contributing guidelines.
- [x] Search for duplicates among the existing issues (both open and closed).
Proposal
It would be nice to have the active
parameter in info_columns()
so that it no longer fails when trying to document a missing column. Here is a small example that explains the problem, what the potential feature might look like, and what I am doing now in the mean time:
library(pointblank)
# this issue
small_table %>%
info_columns(
column = "j",
info = "foo bar"
)
# potential feature, add agent semantics to informant
small_table %>%
info_columns(
column = vars("j"),
info = "foo bar",
active = ~ . %>% has_columns(vars(j))
)
# what i am doing now
small_table %>%
tryCatch(
expr = {
info_columns(
column = "j",
info = "foo bar"
)
}, error = function(e) .
)
Thank you @tyluRp , this is a great proposal!