Pagination of a listing. This can be vertical for long listings with many
rows and/or horizontal if there are many columns. This function is a wrapper of
formatters::paginate_to_mpfs()
and it is mainly meant for exploration and testing.
paginate_listing(
lsting,
page_type = "letter",
font_family = "Courier",
font_size = 8,
lineheight = 1,
landscape = FALSE,
pg_width = NULL,
pg_height = NULL,
margins = c(top = 0.5, bottom = 0.5, left = 0.75, right = 0.75),
lpp = NA_integer_,
cpp = NA_integer_,
colwidths = NULL,
tf_wrap = !is.null(max_width),
rep_cols = NULL,
max_width = NULL,
col_gap = 3,
fontspec = font_spec(font_family, font_size, lineheight),
verbose = FALSE,
print_pages = TRUE
)
A list of listing_df
objects where each list element corresponds to a separate page.
(listing_df
or list
)
the listing or list of listings to paginate.
(string
)
name of a page type. See page_types
. Ignored
when pg_width
and pg_height
are set directly.
(string
)
name of a font family. An error will be thrown
if the family named is not monospaced. Defaults to "Courier"
.
(numeric(1)
)
font size. Defaults to 12
.
(numeric(1)
)
line height. Defaults to 1
.
(flag
)
whether the dimensions of page_type
should be
inverted for landscape orientation. Defaults to FALSE
, ignored when pg_width
and
pg_height
are set directly.
(numeric(1)
)
page width in inches.
(numeric(1)
)
page height in inches.
(numeric(4)
)
named numeric vector containing "bottom"
, "left"
,
"top"
, and "right"
margins in inches. Defaults to .5
inches for both vertical
margins and .75
for both horizontal margins.
(numeric(1)
or NULL
)
number of rows/lines (excluding titles and footers)
to include per page. Standard is 70
while NULL
disables vertical pagination.
(numeric(1)
or NULL
)
width (in characters) of the pages for horizontal
pagination. NULL
(the default) indicates no horizontal pagination should be done.
(numeric
)
vector of column widths (in characters) for use in vertical pagination.
(flag
)
whether the text for title, subtitles, and footnotes should be wrapped.
(numeric(1)
)
number of columns (not including row labels) to be repeated on every page.
Defaults to 0.
(integer(1)
, string
or NULL
)
width that title and footer (including
footnotes) materials should be word-wrapped to. If NULL
, it is set to the current print width of the
session (getOption("width")
). If set to "auto"
, the width of the table (plus any table inset) is
used. Parameter is ignored if tf_wrap = FALSE
.
(numeric(1)
)
width of gap between columns, in same units as extent in pagdf
(spaces
under a particular font specification).
(font_spec
)
a font_spec object specifying the font information to use for
calculating string widths and heights, as returned by font_spec()
.
(flag
)
whether additional informative messages about the search for
pagination breaks should be shown. Defaults to FALSE
.
(flag
)
whether the paginated listing should be printed to the console
(cat(toString(x))
).
dat <- ex_adae
lsting <- as_listing(dat[1:25, ], disp_cols = c("USUBJID", "AESOC", "RACE", "AETOXGR", "BMRKR1"))
mat <- matrix_form(lsting)
cat(toString(mat))
paginate_listing(lsting, lpp = 10)
paginate_listing(lsting, cpp = 100, lpp = 40)
paginate_listing(lsting, cpp = 80, lpp = 40, verbose = TRUE)
Run the code above in your browser using DataLab