From ripley at stats.ox.ac.uk  Fri Dec 26 15:32:11 2008
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Fri, 26 Dec 2008 14:32:11 +0000 (GMT)
Subject: [Rd] issue with [[<-Call
In-Reply-To: <EDFDBF4E8E9AE049A9BB81801F493041271E42@msgebe21.mfad.mfroot.org>
References: <EDFDBF4E8E9AE049A9BB81801F493041271E42@msgebe21.mfad.mfroot.org>
Message-ID: <alpine.LFD.2.00.0812261427570.31671@gannet.stats.ox.ac.uk>

On Fri, 26 Dec 2008, Therneau, Terry M., Ph.D. wrote:

> Brian,
> Thanks for the comments.
>
> -- I agree that the vector form is more compact.  I was using a loop
> because I found it to be even more transparent to the class.  For a one
> time task such as this efficiency is not an issue.
> -- I'll make use of eval.parent().  I hadn't yet stumbled on that
> -- The code in lm() is almost exactly my "other approach"!  (I doubt
> convergent evolution - I must have noticed this example at some past
> point).
>
>  I was reasoning in parallel to lists
>> temp <- list(a=1:3)
>> temp[['b']] <- 5:6
>> temp
> $a
> [1] 1 2 3
> $b
> [1] 5 6
>
> and assumed that this should work for call objects.  The informal
> "underneath it all, all the language objects are lists" idea, which I
> think I absorbed from one of the original Bell Labs books.  I leave it
> to the core team to decide if this should be 'fixed'.

Yes, that is true in S, but in R they are pairlists. The reason [<- works 
is that it converts the pairlist to a list and back again.  Names 
(stricty, 'tags') on pairlists are something of a pain, but I have 
already fixed up this case: some more complex ones remain unfixed.

>
> 	Terry T.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] issue with [[<-Call
Prof Brian Ripley