fingerknit: Render R example

Description Usage Details Value

View source: R/fingerknit.R

Description

Render example from R code stored on the clipboard

Usage

1

Details

Similar to reprex::reprex() or knitr::spin(text=, envir=new.env(), report=FALSE), but stripped down to the very basics. Input is plain valid R code taken from the clipboard. It is run in a fresh environment and both commands and results are catured. Commands are kept as is, but results are commented out. Instead of using three backticks to indicate code for markdown, each line has four whitespaces prepended. fingerknit output is also valid R code.

Value

The clipboard is used for both input and output, but the output is also returned invisibly as a character string. Warnings and errors are not captured, but printed to console as normal. If an error is encountered nothing is returned and the clipboard data remains unchanged.


AkselA/R-ymse documentation built on March 21, 2020, 9:52 a.m.