Package 'WrapRmd'

Title: RStudio Addin for Wrapping RMarkdown Paragraphs
Description: Provides an RStudio addin for wrapping paragraphs in an RMarkdown document without inserting linebreaks into spans of inline R code.
Authors: Tristan Mahr [aut, cre] (ORCID: <https://orcid.org/0000-0002-8890-5116>), Shir Dekel [ctb] (ORCID: <https://orcid.org/0000-0003-1773-2446>)
Maintainer: Tristan Mahr <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9008
Built: 2026-05-12 08:58:36 UTC
Source: https://github.com/tjmahr/WrapRmd

Help Index


Assign argument defaults

Description

Evaluates all comma-separated x = y expressions in a selection. The intended usage is for selecting all of the text between the parentheses in a ⁠function(text = "to", select = "and", evaluate)⁠ call so that default arguments values can be assigned to a user's global environment.

Usage

assign_argument_defaults_addin()

Convert back slashes to forward slashes

Description

Call this addin to convert ⁠\\drive\folder⁠ to ⁠//drive/folder⁠

Usage

flip_backslashes_addin()

Run selection through knitr and commonmark

Description

Call this addin to preview output of an R markdown selection.

Usage

knit_selection_addin()

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


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

Description

Call this addin to wrap paragraphs in an R Markdown document.

Usage

wrap_rmd_addin()

Details

The maximum line width can be set via options(WrapRmd.width). Further fine tuning can be done via options WrapRmd.smart and WrapRmd.extensions, which are passed down to commonmark::markdown_commonmark().


WrapRmd

Description

Provides an RStudio addin for wrapping paragraphs in an RMarkdown document without inserting linebreaks into spans of inline R code.

Author(s)

Maintainer: Tristan Mahr [email protected] (ORCID)

Other contributors: