tonyfischetti/assertr

Allow the the rlang pronoun `.data` to be used

lstmemery opened this issue · 3 comments

Currently this:

library(magrittr)
example_df <- dplyr::data_frame(a = c(1, 2, 3))
example_df %>% 
  assertr::verify(.data$a > 2)
#> Error in eval(expr, envir, enclos): object '.data' not found

fails because of the use of the .data pronoun. .data is useful when creating functions that involve tidy evaluation. For reference, this does work as expected:

library(magrittr)
example_df <- dplyr::data_frame(a = c(1, 2, 3))
example_df %>% 
  assertr::verify(a > 2)
#> verification [a > 2] failed! (2 failures)
#> 
#>     verb redux_fn predicate column index value
#> 1 verify       NA     a > 2     NA     1    NA
#> 2 verify       NA     a > 2     NA     2    NA
#> Error: assertr stopped execution

This actually works with the version of assertr on GitHub thanks to a great series of pull requests by @
@karldw :) I'll close this issue and re-open it if it doesn't work for you after devtools::install_github("ropensci/assertr"). CRAN submission forthcoming.
Thanks for taking the time to report this :)

@tonyfischetti when are you planning the next CRAN release?

Lemme see if I can get to the other issues today and then I can submit a CRAN release!