Is there a way to export the linear regression summaries from R as an image? I need to export the summaries as .jpeg or as .png

旧城冷巷雨未停 提交于 2019-12-08 13:42:54

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!