conroylau / lpinfer

lpinfer: An R Package for Inference in Linear Programs
GNU General Public License v3.0
3 stars 5 forks source link

farg in invertci should default to an empty list #84

Closed a-torgovitsky closed 4 years ago

a-torgovitsky commented 4 years ago
invertci(f = fsst)

gives

Error in invertci.check(f, farg, alpha, lb0, lb1, ub0, ub1, tol, max.iter,  : 
  argument "farg" is missing, with no default

but

invertci(f = fsst, farg = list())

has the expected behavior of using the defaults in fsst

a-torgovitsky commented 4 years ago

Sorry, my mistake, this is a necessary argument because it needs lpm.

conroylau commented 4 years ago

Do you think I can assign NULL as the default here, so that the code can produce an error message that the farg argument is required and it has to be a list of arguments for the testing procedures? Currently, the 'checks' part of the code is checking whether farg is a list. However, this part of checking inputs cannot be ran if the user pass nothing to farg, and results in the above less informative error message. Thanks!

a-torgovitsky commented 4 years ago

If you default to an empty list (list()) won't that solve it? Then if the user doesn't pass anything, the empty list gets passed to whatever testing procedure they use, and then that testing procedure will complain that it does not have enough inputs.

conroylau commented 4 years ago

Yes, that's right! I have just updated the code.