亚洲精品久久久久久第一页-人妻少妇精彩视品一区二区三区-91国产自拍免费视频-免费一级a在线播放视频正片-少妇天天日天天射天天爽-国产大屁股喷水视频在线观看-操美女骚穴抽插性爱视频-亚洲 欧美 中文字幕 丝袜-成人免费无码片在线观看

萬(wàn)能轉(zhuǎn)換:R圖和統(tǒng)計(jì)表轉(zhuǎn)成發(fā)表級(jí)的Word、PPT、Excel、HTML( 三 )


導(dǎo)出到office(ppt和word)中的圖形,是可編輯的:
其它導(dǎo)出到ppt的例子(設(shè)置長(zhǎng)寬比)
graph2ppt(file="ggplot2_plot.pptx", aspectr=1.7)
增加第二張同樣的圖,9英寸寬和A4長(zhǎng)寬比的幻燈片 (append=T,追加)
graph2ppt(file="ggplot2_plot.pptx", width=9, aspectr=sqrt(2), append=TRUE)
添加相同圖形的第三張幻燈片,寬度和高度固定
graph2ppt(file="ggplot2_plot.pptx", width=6, height=5, append=TRUE)
禁用矢量化圖像導(dǎo)出
graph2ppt(x=x, file=filen, vector.graphic=FALSE, width=9, aspectr=sqrt(2), append = TRUE)
用圖填滿幻燈片
graph2ppt(x=x, file=filen, margins=0, upscale=TRUE, append=TRUE)
輸出矢量圖

  • graph2svg: 將當(dāng)前的R圖保存為SVG格式
  • graph2pdf: 將當(dāng)前的R圖保存為PDF格式
  • graph2eps: 將當(dāng)前的R圖保存為EPS格式
函數(shù)參數(shù)解釋
graph2vector(x = NULL, file = "Rplot", fun = NULL, type = "SVG",aspectr = NULL,width = NULL, height = NULL, scaling = 100,font = ifelse(Sys.info()["sysname"] == "Windows","Arial","Helvetica")[[1]], bg = "white", colormodel = "rgb",cairo = TRUE,fallback_resolution = 600, ...)
  • fallback_resolution: dpi中的分辨率用于柵格化不支持的矢量圖形 。
#需運(yùn)行上面的ggplot2繪圖# Create a file namefilen <- "output_filename" # or# filen <- paste("YOUR_DIR/ggplot")# There are 3 ways to use graph2vector():### 1. Pass the plot as an object# 導(dǎo)出圖形對(duì)象graph2svg(x=x, file=filen, aspectr=2, font = "Times New Roman",height = 5, bg = "white")graph2pdf(x=x, file=filen, aspectr=2, font = "Arial",height = 5, bg = "transparent")graph2eps(x=x, file=filen, aspectr=2, font = "Arial",height = 5, bg = "transparent")# 導(dǎo)出當(dāng)前預(yù)覽窗口呈現(xiàn)的圖### 2. Get the plot from current screen devicexgraph2svg(file=filen, aspectr=2, font = "Arial",height = 5, bg = "transparent")graph2pdf(file=filen, aspectr=2, font = "Times New Roman",height = 5, bg = "white")graph2eps(file=filen, aspectr=2, font = "Times New Roman",height = 5, bg = "white")# 導(dǎo)出自定義函數(shù)輸出的一系列圖### 3. Pass the plot as a functiongraph2svg(file=filen, fun = plot.fun, aspectr=2, font = "Arial",height = 5, bg = "transparent")graph2pdf(file=filen, fun=plot.fun, aspectr=2, font = "Arial",height = 5, bg = "transparent")graph2eps(file=filen, fun=plot.fun, aspectr=2, font = "Arial",height = 5, bg = "transparent")
轉(zhuǎn)換3D圖形rgl2png: 將當(dāng)前的rgl 3D圖形保存為PNG格式 。
rgl2bitmap(file = "Rplot", type = c("PNG"))
# Create a file namefilen <- tempfile("rgl") # or# filen <- paste("YOUR_DIR/rgl")# Generate a 3D plot using 'rgl'x = y = seq(-10, 10, length = 20)z = outer(x, y, function(x, y) x^2 + y^2)rgl::persp3d(x, y, z, col = 'lightblue')# Save the plot as a pngrgl2png(file = filen)# Note that omitting 'file' will save in current directory
生成的3D圖形:
將生成的3D圖形保存為PNG格式:
輸出統(tǒng)計(jì)結(jié)果到表格 table2spreadsheet
  • table2excel: 導(dǎo)出統(tǒng)計(jì)輸出到Microsoft Office Excel/ LibreOffice Calc電子表格中的一個(gè)表.
  • table2csv:將統(tǒng)計(jì)輸出以CSV格式導(dǎo)出到表中(“,”表示值分隔,“ 。”表示小數(shù))
  • table2csv2: 將統(tǒng)計(jì)輸出以CSV格式導(dǎo)出到表中(“;”表示值分隔,”,”表示小數(shù))
table2spreadsheet(x = NULL, file = "Rtable", type = c("XLS", "CSV","CSV2"), append = FALSE, sheetName = "new sheet", digits = 2,digitspvals = 2, trim.pval = TRUE, add.rownames = FALSE, ...)