簡體   English   中英

如何在 flextable save_as_image 例程中顯示特殊字符

[英]How to display special characters in flextable save_as_image routine

Flextable 的save_as_image函數似乎只能理解 ASCII 字符。 有解決方法嗎?

最小的工作示例

library(flextable)
library(officer)
ft <- flextable(
  head(mtcars),
  col_keys = c("mpg"))
ft <- set_header_labels(ft, mpg = "n°")
ft

library(webshot)
if( require("webshot") ){
  save_as_image(x = ft, path = "./test.png")
}

預期產出

在此處輸入圖像描述

實際輸出

在此處輸入圖像描述

["

library(flextable)
library(officer)
ft <- flextable(
  head(mtcars),
  col_keys = c("mpg"))
ft <- set_header_labels(ft, mpg = "n\u00b0")
ft

library(webshot)
if( require("webshot") ){
  save_as_image(x = ft, path = "./test.png")
}

暫無
暫無

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

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