[Rd] Wishlist: pass args from demo() to source()

Gabor Grothendieck ggrothendieck at gmail.com
Sun Nov 2 15:33:51 CET 2008

Currently demo calls source with a hard coded max.deparse.length = 250
so you can't really see the demo properly in some cases.  Note the
[TRUNCATED] below.  (1) It would be nice if demo passed max.deparse.length
(and other args to source).  (2) Also a larger max.deparse.length default would
be nice to make it less likely one would have to set it in the first place.

> R.version.string # Vista
[1] "R version 2.8.0 Patched (2008-10-21 r46766)"
> demo("gsubfn-si")

        ---- ~~~~~~~~~

Type  <Return>   to start :

> # given number possibly followed by SI letter (e.g. 32.5k where k means 1000)
> # replace letter with e followed by appropriate digits.
> # (see formatEng2R by Hans-Joerg Bibiko in the R Wiki)
> conv <- list(y = "e-24", z = "e-21", a = "e-18", f .... [TRUNCATED]

> gsubfn(".$", conv, c("19", "32.5M"))
[1] "19"     "32.5e6"

More information about the R-devel mailing list