I've just checked out Jens Oehlschlgel's posting as regards assigning with the ``='' operator. Yep, the phenomenon described really does happen. And yep, it sure seems ***very*** dangerous to me. Mind you, using ``='' as the assignment operator strikes me as being dangerous anyhow. Bad design decision by the S people (by John Chambers?) and R should ***not*** have followed suit, compatibility or no compatibility. The best workaround for the problem raised by Jens is ***NEVER NEVER NEVER*** use ``='' as the assigment operator. But the R core team should take steps to get rid of this behaviour (or better still, get rid of ``='' as assignment!!!). cheers, Rolf Turner rolf at math.unb.ca -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Rolf Turner <rolf at math.unb.ca> writes:> I've just checked out Jens Oehlschlgel's posting as regards assigning > with the ``='' operator. Yep, the phenomenon described really does > happen. And yep, it sure seems ***very*** dangerous to me. > > Mind you, using ``='' as the assignment operator strikes me as being > dangerous anyhow. Bad design decision by the S people (by John > Chambers?) and R should ***not*** have followed suit, compatibility > or no compatibility. > > The best workaround for the problem raised by Jens is > > ***NEVER NEVER NEVER*** use ``='' as > the assigment operator. > > But the R core team should take steps to get rid of this behaviour > (or better still, get rid of ``='' as assignment!!!).Well, we haven't exactly advertised it very much... Mainly, it is there because it is used in some books (John's green one, notably) and it's nice to allow people to use it with R. You're not allowed to use it in while and if conditions, so the danger is limited, but if you insist on goofing, you can do a = (b = 3) + 1 when you intended a = (b == 3) + 1 but then again you can also do t.sim <- simulation.that.runs.for.hours() sum(t.sim>1.96) sum(t.sim<-1.96) as I suspect everyone has done at some point.... The subassignment behaviour is surely a bug, although not easily spotted. do_set has switch (PRIMVAL(op)) { case 1: case 3: /* <-, = */ ... so clearly the intention is that they are the same, but the "op" is getting passed down into somewhere where it matters, obviously... -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 Wed, 22 May 2002, Rolf Turner wrote:> > I've just checked out Jens Oehlschlgel's posting as regards assigning > with the ``='' operator. Yep, the phenomenon described really does > happen. And yep, it sure seems ***very*** dangerous to me.Yes. It's a bug, as I said yesterday. It happened with <- in previous versions of R. It only happens under fairly unusual circumstances, which is why it wasn't fixed earlier.> Mind you, using ``='' as the assignment operator strikes me as being > dangerous anyhow. Bad design decision by the S people (by John > Chambers?) and R should ***not*** have followed suit, compatibility > or no compatibility.It's actually pretty harmless, since = is forbidden in most of the cases where it would be ambiguous. -thomas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
At 10:59 AM 05/22/2002 -0300, Rolf Turner wrote:>[...] >Mind you, using ``='' as the assignment operator strikes me as being >dangerous anyhow. Bad design decision by the S people (by John >Chambers?) and R should ***not*** have followed suit, compatibility >or no compatibility. >[...]I for one would be delighted to see an option added to R allowing the user to turn off "=" as a valid assignment operator. That would allow maintaining S compatibility for those who want it, while allowing the rest of us an added measure of safety. -- Mike Prager (mprager at alum.mit.edu) Beaufort, North Carolina -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> > Does anybody know a way of fitting an AR(p) model without the first > p-1 parameters?> > The same doubt for MA(q)... > And I would like to do it not only for the ARIMA bult-in function for > R / S-Plus, but for the GARCH module (S-Plus) when modelling the mean > too. > Finally, is there any package for R that fit GARCH models?Check "tseries" in the "arma" functions with the "lag" option you can estimate some p parameters of a AR model. And check also the garch function Best regards! Kenneth -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._