# missing variables left with no default value in function definition
testfn = function(pos, neg, n) {
resolve_missing(pos=n-neg, neg=n-pos, n=pos+neg)
return(tibble::tibble(pos=pos,neg=neg,n=n))
}
testfn(pos=1:4, neg = 4:1)
testfn(neg=1:4, n = 10:7)
try(testfn())
# not enough info to infer the missing variables
try(testfn(neg=1:4))
# the parameters given are inconsistent with the relationships defined.
try(testfn(pos=2, neg=1, n=4))
Run the code above in your browser using DataLab