forked from ClaraMarquardt/ehR
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgenerate_pdf.Rd
48 lines (41 loc) · 1.81 KB
/
generate_pdf.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generate_pdf.R
\name{generate_pdf}
\alias{generate_pdf}
\title{Convert a list of ggplot objects into a (multi-page) PDF.}
\usage{
generate_pdf(ggplt_list, ncol_plot = 3, nrow_plot = 3, output_path,
output_file, orientation = "vertical", share_legend = FALSE,
quiet = FALSE, height_plot = NULL, width_plot = NULL,
height_overall = NULL, width_overall = NULL)
}
\arguments{
\item{ggplt_list}{List of ggplot objects (list - ggplot).}
\item{ncol_plot}{Number of plot columns on each page of the final PDF (integer) [default: 3].}
\item{nrow_plot}{Number of plot rows on each page of the final PDF (integer) [default: 3].}
\item{output_path}{Path where the final PDF is to be saved ("...../") (character).}
\item{output_file}{Namer under which the final PDF is to be saved ("...pdf") (character).}
\item{orientation}{Page orientation of the final PDF (character - "vertical"/"horizontal") [default: "vertical"].}
\item{share_legend}{Whether or not all plots on a page are to share one legend (logical - TRUE/FALSE) [default: FALSE].}
\item{quiet}{Whether to print status updates as individual pages are generated (logical - TRUE/FALSE) [default: FALSE].}
}
\value{
Generate and save a PDF with all plots.
}
\description{
Given a list of ggplot objects - arrange the plots on a page (with a specified number of plots columns/rows per page) and save as a (multi-page) PDF
}
\details{
Maintained by: Clara Marquardt
}
\examples{
\\{dontrun
plot_1 <- ggplot(data=dia[1:15]) +
geom_bar(aes(x=dia_code)) +
theme_basic()
plot_list <- list(plot_1, plot_1, plot_1, plot_1,plot_1, plot_1, plot_1)
generate_pdf(ggplt_list=plot_list, ncol_plot=3, nrow_plot=2,
output_path="", output_file="merge_pdf_test", orientation="horizontal",
share_legend=FALSE, quiet=FALSE)
}
}