dat <- data.frame(x = 1:5, y=(-2):2)
smoke_test(dat, function(d) y > 0) #error: Y not found
smoke_test(dat, function(d) d$y > 0) # issue: output too long, not robust against NA
smoke_test(dat, function(d) sum(d$y > 0) > 2) # issue: not robust against NA
smoke_test(dat, function(d) sum(d$y > 0, na.rm=TRUE) > 2) # OK
Run the code above in your browser using DataLab