eoffice包用法
2020-12-16 本文已影响0人
灵活胖子的进步之路
eoffice包的官方说明文档如下
Provides wrap functions to export and import graphics and data frames in R to 'microsoft' office. And This package also provide write out figures with lots of different formats. Since people may work on the platform without GUI support, the package also provide function to easily write out figures to lots of different type of formats. Now this package provide function to extract colors from all types of figures and pdf files.
从说明看出,这个包不仅可以把当前画板的图或者ggplot2的图保存为PPTX格式,而且还有读入及输出office各种的常用格式,以下仅简单介绍常用的方法
#载入包及数据集
library(eoffice)
library(ggpubr)
attach(mtcars)
df <- mtcars
#绘制小提琴图
p<- ggviolin(df,
x="cyl",
y="wt",
color = "cyl",
fill = "cyl",
palette = "jco")
p#画板显示图
topptx(p,"violin.pptx")#存入当前工作目录并命名



