有没有办法将R的线性回归摘要导出为图像?我需要将摘要导出为.jpeg或.png [英] 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

查看:93
本文介绍了有没有办法将R的线性回归摘要导出为图像?我需要将摘要导出为.jpeg或.png的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用"R2PPT"包将线性回归摘要导出到R的幻灯片.但是没有将".txt"文件导出到powerpoint中的选项,因此只有"jpeg"文件可以.有人可以帮我吗?

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?

推荐答案

"Stargazer"软件包可让您将摘要导出为格式精美的html,LaTex或纯ASCII文本. 只需在浏览器中打开生成的html文件,将其原样复制或捕获为图像并将其粘贴到演示文稿中即可.

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")

带有lm摘要的PNG

这篇关于有没有办法将R的线性回归摘要导出为图像?我需要将摘要导出为.jpeg或.png的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆