For example, if I have a list of lm objects, how can I pass it to the function anova?
I tried searching for any references to variadic functions in R, or any similar functions to the apply of LISP, with no success.
EDIT: I got it, this can be done via do.call, according to this answer.
The
lapplyfunction is your friend. Here is a complete but nonsensical example:At this point, we have list with candidate dependent variables, and a common set of regressors. So let’s use
lapply()to run several regressions at once, and then againto, say, extract coefficients.