benbhansen-stats / propertee

Prognostic Regression Offsets with Propagation of ERrors, for Treatment Effect Estimation (IES R305D210029).
https://benbhansen-stats.github.io/propertee/
Other
2 stars 1 forks source link

explicit arguments vs `...` in `lmitt` #45

Closed josherrickson closed 2 years ago

josherrickson commented 2 years ago

Not an immediate decision to be made, but eventually we'll want to decide what arguments in lmitt which are passed to lm are explicitly named versus what arguments we leave to ....

E.g., we can define lmitt as either of these:

lmitt <- function(formula, design, data, ...)
lmitt <- function(formula, design, ...)

and in both cases, a call like lmitt(y ~ x, data = mydata) would work just fine. If we explicitly add the argument, we can document it, but if we leave it in ..., we don't need to.

The most extreme case, which I had at one point, you can still see here:

https://github.com/benbhansen-stats/flexida/blob/bd269798c0507d9df5c5dd11ff5849cb0aa0a36f/R/lmitt.R#L30-L45

benthestatistician commented 2 years ago

The consequences of this decision are murky for me. Documentation is one; thanks for listing it.

How about auto-complete? Are there implications regarding whether the function will complain if the argument isn't specified?

josherrickson commented 2 years ago

Good call, autocomplete won't work for arguments in ....

josherrickson commented 2 years ago

The codebase has progressed past the need for this discussion.