
Function to export a figure with custom settings
ama_export_fig.RdThis 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.
Examples
if (FALSE) { # \dontrun{
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
} # }