| fc_export | R Documentation |
This function allows you to export the drawn flowchart to the most popular graphic formats, including bitmap formats (png, jpeg, tiff, bmp) and vector formats (svg, pdf). For bitmap formats, it uses the ragg package devices when available for higher performance and higher quality output than standard raster devices provide by grDevices.
fc_export(
object,
filename,
path = NULL,
format = NULL,
width = NA,
height = NA,
units = NULL,
res = 100,
...
)
object |
fc object that we want to export. |
filename |
File name to create on disk. |
path |
Path of the directory to save plot to: path and filename are combined to create the fully qualified file name. Defaults to the working directory. |
format |
Name of the graphic device. One of |
width, height |
Plot size in units expressed by the |
units |
One of the following units in which the width and height arguments are expressed: |
res |
The nominal resolution in ppi which will be recorded in the bitmap file, if a positive integer. Also used for units other than the default, and to convert points to pixels. Default is 100 if exporting in bitmap format. This argument is unused if exporting to a vector format. |
... |
Arguments to be passed to the device function used to save the flowchart. The available parameters will differ depending on the format (e.g., png). |
Vector Formats ('svg', 'pdf'): These formats are ideal for graphics that need to be scaled without loss of quality. The default units for width and height are inches. If user specifies units other than inches ("mm" or "cm"), the function will convert the dimensions to inches using standard conversion formulas.
Bitmap Formats ('png', 'jpeg', 'tiff', 'bmp'): For these formats (with the exception of "bmp"), the function uses the ragg package devices when available, providing higher performance and higher quality output. The default units for width and height are pixels.
Suggested Dependencies: For superior performance and quality bitmap outputs, it is recommended to install the ragg package. For exporting to "pdf" format with enhanced features, the Cairo graphics library will be used if it is available.
Invisibly returns the same object that has been given to the function.
## Not run:
safo |>
as_fc(label = "Patients assessed for eligibility") |>
fc_filter(!is.na(group), label = "Randomized", show_exc = TRUE) |>
fc_draw() |>
fc_export("flowchart.png")
#Specifying size and resolution
safo |>
as_fc(label = "Patients assessed for eligibility") |>
fc_filter(!is.na(group), label = "Randomized", show_exc = TRUE) |>
fc_draw() |>
fc_export("flowchart.png", width = 3000, height = 4000, res = 700)
#Exporting to an SVG file
safo |>
as_fc(label = "Patients assessed for eligibility") |>
fc_filter(!is.na(group), label = "Randomized", show_exc = TRUE) |>
fc_draw() |>
fc_export("flowchart.svg")
#Exporting to a PDF file
safo |>
as_fc(label = "Patients assessed for eligibility") |>
fc_filter(!is.na(group), label = "Randomized", show_exc = TRUE) |>
fc_draw() |>
fc_export("flowchart.pdf")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.