Learn R Programming

r2rtf (version 1.0.2)

nrow_paragraph: Calculate Number of Rows for a Paragraph

Description

Calculate number of rows for a paragraph like title, subline, footnote, source

Usage

nrow_paragraph(tbl, size, padding = 0.2)

Value

an integer (number of rows) for title, subline, footnote, or source

Arguments

tbl

A data frame's rtf_title, rtf_subline, rtf_footnote, or rtf_source attribute containing strwidth attribute

size

Size of a line in inches

padding

Cell padding in inches

Specification

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

Examples

Run this code
library(dplyr) # required for running example
tb <- head(iris) %>%
  rtf_title(title = "Iris example") %>%
  rtf_footnote(footnote = c("footnote 1", "footnote 2")) %>%
  rtf_body()

r2rtf:::nrow_paragraph(attr(tb, "rtf_title"), 6.25)
r2rtf:::nrow_paragraph(attr(tb, "rtf_footnote"), 6.25)

Run the code above in your browser using DataLab