The system I use in the online files for
Statistical Analysis and Data Display
Richard M. Heiberger and Burt Holland
http://springeronline.com/0-387-40270-5
is based on the R function is.R(). The is.R function is slightly more
complex than the recommendation Rolf Turner just posted, so I would not
recommend
using that simple version.
I do this often enough that I wrote a wrapper if.R() with the syntax
if.R(s={},
r={})
where you can put very complex statements inside the braces.
In order to do this I need to define
if.R <- function(r, s)
{
if(exists("is.R") && is.R())
r
else s
}
If you wanted to go more elementary than my if.R function, then you would need
to define in S-Plus a function
is.R <- function() FALSE
Then the statement is.R() would work correctly in both languages.
Rich
|