[Rd] Extending suggestion for stopifnot

Gabor Grothendieck ggrothendieck at gmail.com
Wed Aug 21 00:28:43 CEST 2013


On Tue, Aug 20, 2013 at 6:00 PM, ivo welch <ivo.welch at gmail.com> wrote:
> character string at the end of an existing function, stopifnot().  (2)
> I think "estrings" (that behave like characters but are interpolated
> before printout) are useful in the same way perl interpolated strings
> are useful.

The gsubfn package has string interpolation somewhat like perl.
Preface a function call with fn$ and then back ticks and $ are
interpolated.

library(gsubfn)
fn$identity("pi is $pi")

library(sqldf)
fn$sqldf("select * from BOD where Time > $pi")

fn$stop("class is `class(pi)`")



More information about the R-devel mailing list