On 07-Oct-07 21:51:29, Rolf Turner wrote: > > On 8/10/2007, at 10:01 AM, Deepayan Sarkar wrote: >>[...] >> I'm not sure exactly which part you didn't expect. Given this >> definition of plotb, I would expect >> >> plotb(x,cos(x)) >> >> to expand to >> >> plot(x, pch="+", col="blue", cos(x)) >> >> and as far as I can tell, these give identical results. >> Is that what surprises you? Why? >> >> The other possibility is that you are surprised by the behavior of >> >> plot(x, pch="+", col="blue", cos(x)) >> >> Remember that named arguments trump positional matching, and >> consequently, this is equivalent to >> >> plot(x, cos(x), pch="+", col="blue") > > I think that this is the crucial issue. I'm guessing that what > puzzled Ted (it is what certainly puzzled me) was ``how did > plot() know that cos(x) was the y-value?''
Exactly! > Your (very well expressed) explanation makes this clear. Agreed! > cheers, > > Rolf Turner And Cheers! Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <[EMAIL PROTECTED]> Fax-to-email: +44 (0)870 094 0861 Date: 08-Oct-07 Time: 00:10:45 ------------------------------ XFMail ------------------------------ ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.