Printing ggplot object or list of objects to a PDF file with added compliance information log file

Flexible function to allow single or multi-page PDFs. A single ggplot object can be passed or a list of ggplot objects. If a list is passed the plots are arranged in a grid that can be defined by arguments nrow and ncol. By default these are set to 1 each, plotting a single graphics object on a single page in the PDF. The compliance log file will only be generated if .COMPLIANCE_MODE is set to TRUE. The name of the generated compliance log file is the same name as the text file name but with appended ".log". The extension for the exported text file will be kept unchanged in the exported log file name. In order for the log file generation to work the global variable "COMPLIANCE_MODE_SCRIPT_NAME" needs to be defined by the user and in each R script set to the name of the script - this is done using the IQRinitCompliance function. If compliance model is enabled, the original graphics object will also be stored as an RDS file, allowing subsequent further processing.

IQRoutputPDF(
  gr,
  filename = NULL,
  width = 21/2.54,
  height = 21/2.54 * 3/4,
  scale = 1,
  scaleWidth = 1,
  scaleHeight = 1,
  nrow = 1,
  ncol = 1,
  ...
)

Arguments

gr

ggplot graph object to be printed to file

filename

Character string with the filename (can include path) for export. Should include extension to the filename (.pdf).

width

width of figure in inch

height

height of figure in inch

scale

relative factor for scaling of both width and height

scaleWidth

relative factor for scaling width

scaleHeight

relative factor for scaling height

nrow

Number of rows for grid plotting if graphics object is a list

ncol

Number of columns for grid plotting if graphics object is a list

...

Additional arguments passed to pdf()

See also