On 27.05.2022 17:29, Arne Henningsen wrote:
Dear all (cc Marek = maintainer of the stargazer package) We use do.call() to automatically create many LaTeX tables with stargazer but after upgrading to R 4.2.0, this no longer works. I illustrate this with a simple reproducible example: R> data("USArrests") R> res <- lm( Murder ~ UrbanPop, data = USArrests ) R> library(stargazer) R> stargazer(res) # works as expected R> do.call( stargazer, list(res) ) Error in if (is.na(s)) { : the condition has length > 1
Without looking at the code in detail: The line aboce suggests the code needs an any(): if(any(is.na(x))) raher than if(is.na(x)).
Best, Uwe Ligges
Any ideas what we can do so that the last command works with R 4.2.0? /Arne
______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.