问题
I am trying to export the linear regression summary to a powerpoint slide by R using the "R2PPT" package. But there is no option to export ".txt" file into powerpoint, so only "jpeg" files will do. Can someone please help me with this?
回答1:
The package "Stargazer" would let you export the summary into beautifully formatted html, LaTex or plain ASCII text. Just open the resulting html file in a browser, copy it as is or capture it as an image and paste it into your presentation.
library(stargazer)
data <- as.data.frame(cbind(a = rnorm(30), b = rnorm(30)))
fit_lm <- lm(data, formula = a ~ b)
stargazer(fit_lm, type = "html", out = "fit_lm.html")
PNG with the lm summary
来源:https://stackoverflow.com/questions/45463212/is-there-a-way-to-export-the-linear-regression-summaries-from-r-as-an-image-i-n