Learn R Programming

climatehealth (version 1.0.0)

with_pdf_device: Run plotting code inside a safely managed PDF device.

Description

Run plotting code inside a safely managed PDF device.

Usage

with_pdf_device(output_path, width = 14, height = 8, context = "plot", plot_fn)

Value

None. Writes a PDF and closes device safely.

Arguments

output_path

Character. Output path for the PDF file.

width

Numeric. PDF width in inches.

height

Numeric. PDF height in inches.

context

Character. Context label used in error messages.

plot_fn

Function. Plotting function to execute.