xgx_annotate_filenames

0th

Percentile

Append filenames to bottom of the plot

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.

Usage
xgx_annotate_filenames(dirs, hjust = 0.5)
Arguments
dirs

list containing directories and filenames. It must contain five fields

  1. parent_dir = Parent directory containing the Rscript and the Results folder

  2. rscript_dir = Subdirectory ofparent_dir that contains the Rscript used to generate the figure

  3. rscript_name= Name of the Rscript used to generate the figure

  4. results_dir = Subdirectory ofparent_dir where the figure is stored

  5. filename = Filename

hjust

horizontal justification of the caption

Value

None

Aliases
  • xgx_annotate_filenames
Examples
# NOT RUN {
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)

# }
Documentation reproduced from package xgxr, version 1.0.0, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.