Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

xgx_annotate_filenames

Append filenames to bottom of the plot


Description

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, color = "black", size = 11)

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

color

font color for caption, default black

size

font size for caption, default 11

Value

None

Examples

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)

xgxr

Exploratory Graphics for Pharmacometrics

v1.1.1
MIT + file LICENSE
Authors
Andrew Stein [aut, cre], Alison Margolskee [aut], Fariba Khanshan [aut], Konstantin Krismer [aut] (<https://orcid.org/0000-0001-8994-3416>), Matthew Fidler [ctb] (<https://orcid.org/0000-0001-8538-6691>), Novartis Pharma AG [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.