You can write a function that displays stargazer output and saves it to a file without output to the console. For example, adapting the code from this SO answer :
mod_stargazer <- function(output.file, ...) { output <- capture.output(stargazer(...)) cat(paste(output, collapse = "\n"), "\n", file=output.file, append=TRUE) }
Then, to run the function:
mod_stargazer(myfile, regressions[[reg]], header=FALSE)
append=TRUE causes all your tables to be saved in one file. Delete it if you need separate files for each table.
eipi10
source share