[R] Predict polynomial problem

Peter Ehlers ehlers at ucalgary.ca
Tue Jan 19 19:10:21 CET 2010



Barry Rowlingson wrote:
> On Tue, Jan 19, 2010 at 5:37 PM, Charles C. Berry <cberry at tajo.ucsd.edu>wrote:
> 
>>> Note:
>>>
>>>   i <- 20
>>>>  bquote(y ~ poly(x,.(i)))
>>>>
>>> y ~ poly(x, 20)
>>>
>>>
>  I see it now. bquote(y~poly(x,.(i))) gets it's 'i' there and then, sticks
> it in the returned expression as the value '20', so any further evaluations
> get poly(x,20). This is reminiscent of the way macro languages work...
> 
And that might be why ?bquote says:
"An analogue of the LISP backquote macro."
:)

Cheers,
Peter



More information about the R-help mailing list