Learn R Programming

r2rtf (version 1.0.2)

rtf_strwidth: Calculate String Width in Inches

Description

Calculate string width in inches based on font (Times New Roman, Arial, etc.), font size, font style (bold, italic, bold-italic etc.), and text indent.

Usage

rtf_strwidth(tbl)

Value

an object with string width corresponding to each cell in the data frame tbl

Arguments

tbl

A data frame

Specification

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

Examples

Run this code
library(dplyr)
tbl <- data.frame(
  x = rep("This is a long sentence", 5),
  y = "short"
)
tbl %>%
  rtf_body(text_font = c(1, 3)) %>%
  r2rtf:::rtf_strwidth()

Run the code above in your browser using DataLab