Skip to contents

Get the page layout for the pdf document based on the number of plots to display and the number of columns and rows.

Usage

create_page_layout(number_of_plots, ncol = NULL, nrow = NULL)

Arguments

number_of_plots

Number of plots to be output into the pdf document.

ncol

Number of columns of plots allowed in one page of the pdf document. Default: NULL

nrow

Number of rows of plots allowed in one page of the pdf document. Default: NULL

Value

A list containing the number of rows and cols required for one pdf page.

Details

  • If both ncol and nrow are NULL or only ncol is NULL, the layout will have one column and the total number of rows will be the number of plots it needs to produce.

  • If only nrow is NULL, the layout will have one row and the total number of columns will be the number of plots it needs to produce.

Examples

create_page_layout(
  number_of_plots = 4,
  ncol = 2,
  nrow = 2
)
#> $ncol
#> [1] 2
#> 
#> $nrow
#> [1] 2
#>