R-beta: S compatibility

Martin Maechler maechler at stat.math.ethz.ch
Fri Aug 14 14:21:29 CEST 1998


>>>>> "Jim" == Jim Lindsey <jlindsey at alpha.luc.ac.be> writes:

    Jim> Once again, I foolishly attempted a major port of S, ratfor, and
    Jim> Fortran code (hidden Markov models from an article in the latest Can
    Jim> Jr Stat) to R without access to S-Plus itself. Here are some problems
    Jim> I found before abandoning:

    Jim> 1. replicating a factor does not give a factor:
    Jim>	is.factor(rep(gl(2,1,2),2)) is FALSE

This *is* S-plus compatible!
[Try  rep(factor(1:3), 2) ]

	(even though I agree that I'd like to see a factor myself in that case.
	... again: Should we be compatible  or fix inconsistencies .. ?  (;-))


    Jim> 2. sample() does not have the option, prob=
yes.  Volunteers to add it ?

    Jim> 3. glm()$assign does not exist
yes.  Volunteers to add it ? [the same for lm()$assign]

    Jim> 4. glm()$contrast is very different from S - apparently the latter is
    Jim> a list with one member per variable instead of a copy of the options
    Jim> in effect
The next (0.63) version of R will have the same as S, here (I think).

WARNING: The current snapshot of 0.63 is currently somewhat ``more unstable''
	than usual.

    Jim> 5. C() does not exist (something to do with contrasts, which are
    Jim> apparently handled much differently in S-Plus)
	 
    Jim> 6. dummy.coef() does not exist
Yes.
Brian Ripley's  aov  package which should also make it's way into R 0.63,
has  model.tables()  which provides even more than dummy.coef..

Any volunteers (maybe after 0.63) for doing

	C()		[maybe not so easy]
	dummy.coef	[should be easy/trivial, if you have model.tables]

    Jim> 7. something else I have now forgotten...
:-)

    Jim> In general, almost all aspects of model fitting in the two seem to be
    Jim> completely incompatible.
         ^^^^^^^^^^
	well, well..

	This is true if you look at the ``low-level'' structure of returned
	objects.
	However, the ``normal user interface'' is VERY compatible
	Also, many of the accessor functions  
		[coef(), resid(), effects(), summary(), predict()]
	return the same thing or something very close to S'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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list