xgx_annotate_filenames
appends file details to the bottom of a plot
using the plot caption option.
File details to append include the parent directory, the path of the R
script which generated the plot,
and the path of the plot.
xgx_annotate_filenames(dirs, hjust = 0.5, color = "black", size = 11)
list containing directories and filenames. It must contain five fields
parent_dir = Parent directory containing the Rscript and the Results folder
rscript_dir = Subdirectory ofparent_dir that contains the Rscript used to generate the figure
rscript_name= Name of the Rscript used to generate the figure
results_dir = Subdirectory ofparent_dir where the figure is stored
filename = Filename
horizontal justification of the caption
font color for caption, default black
font size for caption, default 11
None
dirs <- list(parent_dir = "/your/parent/path/",
rscript_dir = "./Rscripts/",
rscript_name = "Example.R",
results_dir = "./Results/",
filename = "your_file_name.png")
data <- data.frame(x = 1:1000, y = rnorm(1000))
ggplot2::ggplot(data = data, ggplot2::aes(x = x, y = y)) +
ggplot2::geom_point() +
xgx_annotate_filenames(dirs)