Closed jaspercooper closed 4 years ago
Thanks to @notanastronomer for the heads up on this! I've edited her MWE below a bit.
People often like to carry around lists of lm fits, e.g. using lapply over a list of formulas. Currently, these are not handled by starprep().
starprep()
library(estimatr) library(stargazer) a <- lm(mpg ~ cyl, mtcars) b <- lm(mpg ~ cyl + disp, mtcars) c <- lm(mpg ~ cyl + disp + hp, mtcars) abc <- list(a, b, c) ab <- list(a, b) # Works starprep(a,b,c) # Breaks starprep(abc) # Works starprep(a,b) # Breaks starprep(ab)
This behavior worries me a bit, as I can see people doing something like this:
stargazer(a, b, se = starprep(ab), type = "text")
Expecting to get this:
stargazer(a, b, se = starprep(a,b), type = "text")
I've written an admittedly very quick and dirty fix in this PR, in case it's helpful to build off.
@nfultz addressed the two comments on last commit, please lmk if this seems clearer and less error-prone
Requesting review @nfultz @lukesonnet. I merged in Luke's PR to this one.
LGTM.
Thanks to @notanastronomer for the heads up on this! I've edited her MWE below a bit.
People often like to carry around lists of lm fits, e.g. using lapply over a list of formulas. Currently, these are not handled by
starprep()
.This behavior worries me a bit, as I can see people doing something like this:
Expecting to get this:
I've written an admittedly very quick and dirty fix in this PR, in case it's helpful to build off.