From 8a53da414be4d4861741cc536f00033f290e5e17 Mon Sep 17 00:00:00 2001 From: pstew Date: Thu, 30 May 2019 14:01:43 -0400 Subject: [PATCH] Add support for imagetype = 'pdf' --- NAMESPACE | 2 +- R/venn.diagram.R | 8 ++++++++ man/venn.diagram.Rd | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 0ab6cf1..9279be8 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -23,7 +23,7 @@ export( calculate.overlap, get.venn.partitions ) -importFrom("grDevices", "dev.off", "png", "svg", "tiff") +importFrom("grDevices", "dev.off", "png", "svg", "tiff", "pdf") importFrom("stats", "aggregate", "setNames", "phyper") importFrom("utils", "capture.output", "combn") import(grid, diff --git a/R/venn.diagram.R b/R/venn.diagram.R index b31c0a1..4fbba07 100644 --- a/R/venn.diagram.R +++ b/R/venn.diagram.R @@ -485,6 +485,14 @@ stop('Invalid size of input object'); ); } + # PDF image type specified + else if('pdf' == imagetype) { + pdf( + file = filename, + height = height, + width = width + ); + } # Invalid imagetype specified else { flog.error("You have misspelled your 'imagetype', please try again",name="VennDiagramLogger") diff --git a/man/venn.diagram.Rd b/man/venn.diagram.Rd index a3fdbd1..bb611e7 100644 --- a/man/venn.diagram.Rd +++ b/man/venn.diagram.Rd @@ -24,7 +24,7 @@ venn.diagram(x, filename, height = 3000, width = 3000, resolution = \item{height}{Integer giving the height of the output figure in units} \item{width}{Integer giving the width of the output figure in units} \item{resolution}{Resolution of the final figure in DPI} - \item{imagetype}{Specification of the image format (e.g. tiff, png or svg)} + \item{imagetype}{Specification of the image format: tiff, png, svg, pdf} \item{units}{Size-units to use for the final figure} \item{compression}{What compression algorithm should be applied to the final tiff} \item{na}{Missing value handling method: "none", "stop", "remove"}