assert_all_are_before error due to missing "y" argument

Issue #7 new
Former user created an issue

When I try to run:

assertive::assert_all_are_before(as.Date("2018-10-28"), as.Date("2018-10-29"))

I'm getting the following error message: Error in is(x, class) : argument "y" is missing, with no default

This seems to be due to a missing "y = y" argument in the call to "assert_engine" within the "assert_all_are_before" function. When I redefine the function as follows:

assert_all_are_before_v2 <- function(x, y, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
     {            
             .xname = get_name_in_parent(x)  
             .yname = get_name_in_parent(y)                                           
             msg <- gettextf("%s are not all before %s.", .xname, .yname)
             assert_engine(
                     is_before,
                     x, 
                     **y = y,**
                     .xname = .xname,
                     .yname = .yname,
                     msg = msg, 
                     na_ignore = na_ignore,
                     severity = severity
                 ) 
         }

The following check passes:

assert_all_are_before_v2(as.Date("2018-10-28"), as.Date("2018-10-29"))

Thanks.

Comments (0)

  1. Log in to comment