Skip to contents

`export()` will write all information of WuGe into an image. This makes it easy to share it around. For `WuGeName`, all information will be written into an Excel file, including all possible name combinations, WuGe information of each stroke combination.

Usage

export(
  x,
  file,
  width = 10.5,
  height = 27,
  dpi = 300,
  ...,
  fmt_width = 100,
  verbose = TRUE
)

Arguments

x

An `WuGe` object created using [wuge()] or an `WuGeName` object created using [name()].

file

For `WuGe` object, a path of image passed to [ggplot2::ggsave()]; for `WuGeName` object, a path of an Excel file passed to [openxlsx::saveWorkbook()].

width, height, dpi

The size and resolution of image to create. Directly passed to [ggplot2::ggsave()]. Default values are `10.5` inches for `width`, `27` inches for `height` and `300` for dpi. Those values are tested to make sure all possible information can fit into a single image, but also make the saved image large (~2.8MB).

...

Other arguments to be passed to [ggplot2::ggsave()].

fmt_width

An integer number indicating the line width when formatting. It is used to set the option of `cli.width`. Default: `100`.

verbose

If `TRUE`, a progress bar will be shown for long-time export process. Default: `TRUE`.

Value

The full path of the file generated, invisibly.

Examples

if (FALSE) {
export(wuge("张", "三"), "张三.png")

export(name("张", max = 10), "张.xlsx")
}