| saveViz | R Documentation |
This function saves a visualization object to a file in the specified
format and directory. It supports visualizations generated by
chea3_visualizeRank(), ggplot2, or any other plot object that
can be rendered using print() inside a graphics device. Optionally,
the current date (stored in the today variable) can be prepended to
the filename.
saveViz(
viz,
output_dir,
output_file = "figure_rChEA3",
format = "pdf",
with_date = TRUE,
width = 8,
height = 5,
resolution = 300,
verbose = TRUE
)
viz |
A visualization object typically created by
|
output_dir |
A string specifying the output directory. This parameter is required and has no default. |
output_file |
A string specifying the base filename (without
extension). Defaults to |
format |
Output format. One of |
with_date |
Logical (default |
width |
Width of the output file in inches. Default is 8. |
height |
Height of the output file in inches. Default is 5. |
resolution |
Resolution in DPI (only used for PNG). Default is 300. |
verbose |
Logical. If |
The visualization is saved to a file on disk. Invisibly returns the full path to the saved file.
genes <- c("TP53", "MYC", "STAT3")
results <- queryChEA3(genes, verbose = FALSE)
meanRank_res <- results[["Integrated--meanRank"]]
# Create visualization
viz <- visualizeRank(meanRank_res)
# Save as PDF
saveViz(viz, output_dir = tempdir(), output_file = "chea3_results")
# Save as PNG with custom dimensions
saveViz(viz, output_dir = tempdir(), output_file = "chea3_results",
format = "png", width = 10, height = 6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.