str_rmd_wrap: Wrap text but don't insert lines breaks into inline R code

View source: R/package.R

str_rmd_wrapR Documentation

Wrap text but don't insert lines breaks into inline R code

Description

Wrap text but don't insert lines breaks into inline R code

Usage

str_rmd_wrap(string, width = getOption("WrapRmd.width", 80))

Arguments

string

a string to wrap

width

desired line width. Defaults to options("WrapRmd.width").

Details

This function finds all inline R code spans in a string, replaces all non-word characters in the R spans with "Q"s, re-wraps the string, and restores the original inline R spans.

This function preserves blanks lines between paragraphs.

Value

a wrapped copy of the string


tjmahr/WrapRmd documentation built on Feb. 24, 2024, 8:20 p.m.