ama_export_fig.Rd
This function exports a ggplot2 figure to a given path. It exports both an archived version with the current date and a current version without a date. The function supports exporting to PDF and JPG formats.
ama_export_fig(figure, filename, filepath, width = 7, height = 7)
A ggplot2 object.
A character string specifying the filename without the extension.
A character string specifying the directory to save the file.
The width of the image in inches (default is 7 inches).
The height of the image in inches (default is 7 inches).
if (FALSE) {
test_plot <- ggplot(mpg, aes(x=displ, y=hwy)) + geom_point() # Create a ggplot2 plot
filename <- "sample_plot" # Define a filename
filepath <- tempdir() # Define a path using a temporary directory
ama_export_fig(test_plot, filename, filepath) # Call the ama_export_fig function
}