rtf_title: Add Title Attributes to Table

Description Usage Arguments Value Specification Examples

View source: R/rtf_title.R

Description

Add title, subtitle, and other attributes to the object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
rtf_title(
  tbl,
  title = NULL,
  subtitle = NULL,
  text_font = 1,
  text_format = NULL,
  text_font_size = 12,
  text_color = NULL,
  text_background_color = NULL,
  text_justification = "c",
  text_indent_first = 0,
  text_indent_left = 0,
  text_indent_right = 0,
  text_indent_reference = "table",
  text_space = 1,
  text_space_before = 180,
  text_space_after = 180,
  text_convert = TRUE
)

Arguments

tbl

A data frame.

title

Title in a character string.

subtitle

Subtitle in a character string.

text_font

Text font type. Default is 1 for Times New Roman. To vary text font type by column, use numeric vector with length of vector equal to number of columns displayed e.g. c(1,2,3).All possible input can be found in r2rtf:::font_type()$type.

text_format

Text format type. Default is NULL for normal. Combination of format type are permitted as input for e.g. "ub" for bold and underlined text. To vary text format by column, use character vector with length of vector equal to number of columns displayed e.g. c("i","u","ib"). All possible input can be found in r2rtf:::font_format()$type.

text_font_size

Text font size. To vary text font size by column, use numeric vector with length of vector equal to number of columns displayed e.g. c(9,20,40).

text_color

Text color type. Default is NULL for black. To vary text color by column, use character vector with length of vector equal to number of columns displayed e.g. c("white","red","blue"). All possible input can be found in grDevices::colors().

text_background_color

Text background color type. Default is NULL for white. To vary text color by column, use character vector with length of vector equal to number of columns displayed e.g. c("white","red","blue"). All possible input can be found in grDevices::colors().

text_justification

Justification type for text. Default is "c" for center justification. To vary text justification by column, use character vector with length of vector equal to number of columns displayed e.g. c("c","l","r"). All possible input can be found in r2rtf:::justification()$type.

text_indent_first

A value of text indent in first line.

text_indent_left

A value of text left indent.

text_indent_right

A value of text right indent.

text_indent_reference

The reference start point of text indent. Accept table or page_margin

text_space

Line space between paragraph in twips. Default is 0.

text_space_before

Line space before a paragraph in twips.

text_space_after

Line space after a paragraph in twips.

text_convert

A logical value to convert special characters.

Value

the same data frame tbl with additional attributes for table title

Specification

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

Examples

1
2
3
4
5
library(dplyr) # required to run examples
data(r2rtf_tbl1)
r2rtf_tbl1 %>%
  rtf_title(title = "ANCOVA of Change from Baseline at Week 8") %>%
  attr("rtf_title")

r2rtf documentation built on Sept. 10, 2021, 1:06 a.m.