Use do.call :
do.call( stargazer, l )
However, this eliminates passing arguments in the usual way:
> do.call( stargazer, l, type="text" ) Error in do.call(stargazer, l, type = "text") : unused argument (type = "text")
Therefore, you need to add named arguments to the list:
l$type <- "text" l$align <- TRUE l$title <- "Results" do.call( stargazer, l )
Another way to do this is to curry using the stargazer function:
require(functional) sgCurried <- Curry( stargazer, type="text" )
Ari B. Friedman
source share