Render and save a table in png or pdf format
Arguments
- x
an stable object.
- file
the final output file name; if
filehas.texextension, the extension will be replaced with the value informat; if provided as a complete path, directory information will be used asdir(see below).- stem
used to form the final output file name; this argument will override what is provided in
file.- format
the output file format.
- dir
the final output directory; will be overridden if
fileis given as a complete path.- build_dir
the directory where the image will be built.
- ...
passed to
st_aspdf()orst_aspng(), depending on the value offormat.
Details
There is considerable flexibility for specifying the output file name. This flexibility is provided to accommodate several potential different anticipated workflows.
filecan be obtained from thestable_fileattribute onx; this attribute is set when the user specifies the output file name viast_files(); if a.texextension is found onfile, it will be changed to the value found informat; in this case,fileis not expected to contain the full path and the output directory can be specified bydirfilecan be passed by the user; in this case, a complete path can be provided to the output file; this path will override what is indirand a warning is given in case path location is found in both sources; if a.texextension is found onfile, it will be changed to the value found informatstemandformatcan be passed and the output file name will be<dir>/<stem>.<format>
Examples
tab <- stable(stdata(), output_file = "foo.tex")
if (FALSE) { # \dontrun{
ans <- stable_save_image(tab, format = "pdf")
basename(ans)
st_image_show(ans)
} # }
