Skip to contents

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

Usage

nrow_paragraph(tbl, size, padding = 0.2)

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

Value

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

Specification

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

Examples

library(dplyr) # required for running example
#> 
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#> 
#>     filter, lag
#> The following objects are masked from ‘package:base’:
#> 
#>     intersect, setdiff, setequal, union
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)
#> [1] 1
r2rtf:::nrow_paragraph(attr(tb, "rtf_footnote"), 6.25)
#> [1] 2