We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
With the predicate in_set with argument inverse=TRUE, the argument allow.na works in the opposite way to what is expected.
in_set
inverse=TRUE
allow.na
library(dplyr) library(survival) veteran_totals = veteran %>% group_by(celltype) %>% summarise(cell_total = n()) veteran_totals$cell_total[1] <- NA veteran_totals %>% assertr::assert(cell_total, predicate = assertr::in_set(10:20, inverse = TRUE, allow.na = TRUE)) >Column 'cell_total' violates assertion 'assertr::in_set(10:20, inverse = TRUE, allow.na = TRUE)' 1 time > verb redux_fn predicate column index value >1 assert NA assertr::in_set(10:20, inverse = TRUE, allow.na = TRUE) cell_total 1 NA > >Error: assertr stopped execution veteran_totals %>% assertr::assert(cell_total, predicate = assertr::in_set(10:20, inverse = TRUE, allow.na = FALSE)) > # A tibble: 4 × 2 > celltype cell_total > <fct> <int> >1 squamous NA >2 smallcell 48 >3 adeno 27 >4 large 27
I guess you could fix this with a line allow.na = ifelse(inverse, !allow.na, allow.na) in the first line of the function. ?
allow.na = ifelse(inverse, !allow.na, allow.na)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
With the predicate
in_set
with argumentinverse=TRUE
, the argumentallow.na
works in the opposite way to what is expected.I guess you could fix this with a line
allow.na = ifelse(inverse, !allow.na, allow.na)
in the first line of the function. ?The text was updated successfully, but these errors were encountered: