Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rtf_page

Add RTF File Page Information


Description

Add RTF File Page Information

Usage

rtf_page(
  tbl,
  orientation = "portrait",
  width = ifelse(orientation == "portrait", 8.5, 11),
  height = ifelse(orientation == "portrait", 11, 8.5),
  margin = set_margin("wma", orientation),
  nrow = ifelse(orientation == "portrait", 40, 28),
  border_first = "double",
  border_last = "double",
  border_color_first = NULL,
  border_color_last = NULL,
  col_width = width - ifelse(orientation == "portrait", 2.25, 2.5)
)

Arguments

tbl

A data frame.

orientation

Orientation in 'portrait' or 'landscape'.

width

A numeric value of page width in inches. Default is 8.5 inch in portrait orientation or 11.0 inch in landscape orientation.

height

A numeric value of page width in inches. Default is 11.0 inch in portrait orientation or 8.5 inch in landscape orientation.

margin

A numeric vector of length 6 for page margin. The value set left, right, top, bottom, header and footer margin in order. Default value depends on the page orientation and set by r2rtf:::set_margin("wma", orientation)

nrow

Number of rows in each page. Default is 42 rows if portrait orientation and 26 rows in landscape orientation.

border_first

First top border type of the whole table. Default is "double" indicating double line bottom border. All possible input can be found in r2rtf:::border_type()$name.

border_last

Last bottom border type of the whole table. Default is "double" indicating double line bottom border. All possible input can be found in r2rtf:::border_type()$name.

border_color_first

First top border color type of the whole table. Default is NULL for black. All possible input can be found in grDevices::colors().

border_color_last

Last bottom border color type of the whole table. Default is NULL for black. All possible input can be found in grDevices::colors().

col_width

A numeric value of total column width in inch. Default is width - ifelse(orientation == "portrait", 2, 2.5)

Value

the same data frame tbl with additional attributes for page features

Specification

The contents of this section are shown in PDF user manual only.

Examples

library(dplyr) # required to run examples
data(tbl_1)
tbl_1 %>%
  rtf_page() %>%
  attr("page")

r2rtf

Easily Create Presentation-Ready Rich Text Format (RTF) Table and Figure

v0.2.0
GPL-3
Authors
Yilong Zhang [aut, cre], Siruo Wang [aut], Simiao Ye [aut], Madhusudhan Ginnaram [aut], Merck Sharp & Dohme Corp [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.