Skip to content
Prev 324975 / 398502 Next

SPlus script

Here are some examples where I use the exprs argument instead of making a
tempory file and source the file.  I don't know what you are looking for.
(The OP never showed any calls to the functions in defined in his script, so
I don't know what he was doing either.)

  S+>  source( exprs = expression( 12:15, invisible(1/9), log2(1:10)), auto.print=TRUE)
  S+> 12:15
  [1] 12 13 14 15
  S+> invisible(1/9)
  S+> log2(1:10)
   [1] 0.000000 1.000000 1.584963 2.000000 2.321928 2.584963 2.807355 3.000000
   [9] 3.169925 3.321928

  S+> source( exprs = expression( 12:15, invisible(1/9), log2(1:10)), auto.print=TRUE, echo=FALSE)
  [1] 12 13 14 15
   [1] 0.000000 1.000000 1.584963 2.000000 2.321928 2.584963 2.807355 3.000000
   [9] 3.169925 3.321928

  S+> source( exprs = expression( { 12:15 ; log2(1:10) } ), auto.print=TRUE)
  S+> {
          12:15
          log2(1:10)
  }
   [1] 0.000000 1.000000 1.584963 2.000000 2.321928 2.584963 2.807355 3.000000
   [9] 3.169925 3.321928

The next doesn't autoprint because invisible() sets the autprint flag to FALSE in the
caller's frame:
  S+> source( exprs = expression( { 12:15 ; invisible(1/9) ; log2(1:10) } ), auto.print=TRUE)
  S+> {
          12:15
          invisible(1/9)
          log2(1:10)
  }


Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com