簡體   English   中英

將 class 柔性表元素保存到 pdf

[英]Save class flextable element into pdf

我想將 ftmax 和 ftmin 保存為 pdf,我該怎么做?

ftmax <- tablemax %>% head() %>% as.data.frame() %>% add_rownames("Stock") %>% flextable()
ftmin <- tablemin %>% head() %>% as.data.frame() %>% add_rownames("Stock") %>% flextable()

ftmax <- set_caption(ftmax, "Greatest positive deviation from distribution")
ftmin <- set_caption(ftmin, "Greatest negative deviation from distribution")

ftmax <- autofit(ftmax)
ftmin <- autofit(ftmin)

ftmax
ftmin

沒有降價,謝謝

plot a df 的另一種方法很好地表示贊賞

您可以使用擴展名為“.pdf”的 function save_as_image ,如下所示:

library(tidyverse)
library(flextable)
library(webshot)
ftmax <- mtcars %>% head() %>% as.data.frame() %>% add_rownames("Stock") %>% flextable()
#> Warning: `add_rownames()` was deprecated in dplyr 1.0.0.
#> Please use `tibble::rownames_to_column()` instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
ftmin <- mtcars %>% head() %>% as.data.frame() %>% add_rownames("Stock") %>% flextable()

ftmax <- set_caption(ftmax, "Greatest positive deviation from distribution")
ftmin <- set_caption(ftmin, "Greatest negative deviation from distribution")

ftmax <- autofit(ftmax)
ftmin <- autofit(ftmin)

save_as_image(x = ftmax, path = "ftmax.pdf")
save_as_image(x = ftmin, path = "ftmin.pdf")

代表 package (v2.0.1) 於 2022 年 7 月 29 日創建

這是 ftmax 的ftmax

在此處輸入圖像描述

暫無
暫無

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

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