[R] FW: S+ Script Files for R???

Paul Gilbert pgilbert at bank-banque-canada.ca
Mon May 12 17:30:46 CEST 2003

Spencer Graves wrote:
>           How do you handle the S-Plus commands that don't work in R (or
> produce different results)?  My current favorite is as follows:
>           if(is.null(version$language)){S-Plus} else{R}

Another possibility is

    if(exists("is.R") && is.R()) {R} else {S-Plus}

but I find it more convenient to define a small library of functions to put in
an Splus library. These cover a few small differences (my list of these is
getting very short) and provide some functionality of R that is missing from
Splus. This includes

   is.R <- function() {F} #S version

which simplifies the above check to if(is.R()){R} else {S-Plus}.

I would be happy to forward the whole (short) list of functions if you like.

Paul Gilbert

More information about the R-help mailing list