[R] R as a programming language

Gabor Grothendieck ggrothendieck at gmail.com
Wed Nov 7 14:45:15 CET 2007


Most of these have been answered but here are a few
additional options.

On Nov 7, 2007 7:46 AM, Alexy Khrabrov <deliverable at gmail.com> wrote:
>
> Is there anything less ugly than
>
> print(paste("x=",x,"y=",y))
>

> library(gsubfn)
> a <- 1; b <- 2
> fn$cat("a = $a b = $b\n")
a = 1 b = 2

See gsubfn home page at htp://gsubfn.googlecode.com

> -- for routine printing?  Can [1] be eliminated from such simple
> printing?  What about formatted printing?
>

?format, ?formatC, ?prettyNum, ?sprintf

> Is there a way to assign all of
>
> a <- args[1]
> b <- args[2]
> c <- args[3]
>
> in one fell swoop, a lá Python's
>
> a,b,c = args
>

See:

http://finzi.psych.upenn.edu/R/Rhelp02a/archive/36820.html



More information about the R-help mailing list