Skip to content

function in S

3 messages · Laura Pontiggia, Martin Maechler, Kaspar Pflugshaupt

#
I have a function in S, and I need to write the same function in R.
Exist a program to translate from S to R ?

Thank you

Laura Pontiggia


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
Laura> I have a function in S, and I need to write the same function in
    Laura> R.  Exist a program to translate from S to R ?


I use to say that 97% of S(plus) user written code works unaltered in R.
The problem is with the remaining ones.

The R FAQ (mentioned in the footer of every R-help message)
contains a section on intentional differences between R and S(plus).

You might want to work with just one version of code and use the

	if(is.R()) { ## R 

	} else { ## Splus 

        }

The function is.R (in R) is written such that it should work in all
versions of S.

Martin
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On 15.6.2000 10:32 Uhr, Laura Pontiggia wrote:

            
Just try it, it might work straight away. If not, check the R-FAQ for
differences to S-Plus. In my experience, they're not big. There are some
areas where S-Plus offers more features (for example, R does not include
Trellis graphics). 

If you're using something from an external library, remember to load it in R
first (with "library(something"). That got me a few times.

If it still doesn't work and you're really interested in finding out, look
up "S Programming" by Venables and Ripley (Springer, 2000) which covers the
fundamental differences between both implementations in-depth; or come back
to the list with the problems.

Cheers & good luck

Kaspar Pflugshaupt