簡體   English   中英

rvg包中的Officer :: ph_location_fullsize()等價的是什么?

[英]What is the equivalent of officer::ph_location_fullsize( ) in the package rvg?

我想將多個可食用的地塊和桌子從R導出到PowerPoint。

以下是我擁有的代碼片段以及我正在使用的軟件包:

library(ggplot2)
library(dplyr)
library(tidyr)
library(gridExtra)
library(grid)
library(officer)
library(rvg)

read_pptx() %>%
   add_slide(layout = "Title and Content", master = "Office Theme") %>%
   ph_with_vg(code = grid.arrange(plot, table, col = 1), type = "body") %>%
   print(target = path)

在輸出中,導出的圖形和表格僅覆蓋幻燈片的底部2/3。 如何修改我的代碼,以便我嘗試導出的內容可以占據整個幻燈片?

另一個問題:如果我想在幻燈片上添加標題,如何指定文本的對齊方式(首選),大小和顏色? 默認對齊方式是居中,但我還沒有找到解決方法。

謝謝。

使用ph_location_fullsize() ,它將起作用。

library(officer)
library(magrittr)
library(rvg)

read_pptx() %>%
  add_slide(layout = "Title and Content", master = "Office Theme") %>%
  ph_with(value = dml(barplot(1:5)), location = ph_location_fullsize()) %>%
  print(target = "test.pptx")

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM