Re: [Rd] typo in ?eapply

From: Hervé Pagès <hpages_at_fhcrc.org>
Date: Wed, 10 Nov 2010 10:42:53 -0800

On 11/10/2010 10:38 AM, Hervé Pagès wrote:

> On 11/10/2010 05:02 AM, Prof Brian Ripley wrote:

>> On Tue, 9 Nov 2010, Hervé Pagès wrote:
>>
>>> Hi,
>>>
>>> Found in ?eapply (in current R-devel):
>>>
>>> \value{
>>> A named (unless \code{USE.NAMES = FALSE}) list. Note that the order of
>>> the components is arbitrary for hashed environments: currently it will
>>> be in the order the name-value pairs were added for unhashed
>>> ^^^^^^^^
>>> hashed?
>>> environments.
>>> }
>>>
>>> This looks like a typo.
>>
>> Only to someone who does not understand hashing. Please try it for
>> yourself:
>>
>> e <- new.env(hash=TRUE)
>> assign("a", 1, e)
>> assign("ab", 2, e)
>> assign("abcde", 2, e)
>> assign("ac", 3, e)
>> assign("b", 4, e)
>> names(eapply(e, mean))
>>
>> (and I get
>> [1] "a" "b" "abcde" "ab" "ac"
>> )
>
> The statement is about unhashed environment:
>
>  > e <- new.env(hash=TRUE)
>  > assign("b", 1L, e)
>  > assign("a", 2L, e)
>  > eapply(e, identity)
> $a
> [1] 2
>
> $b
> [1] 1
>
> so it doesn't look like it's true either.

Sorry I try again:

 > e <- new.env(hash=FALSE)
 > assign("b", 1L, e)
 > assign("a", 2L, e)
 > eapply(e, identity)

$a
[1] 2

$b
[1] 1

pfffff!! Sorry for the noise... :-b

H.

>
> Thanks,
> H.
>
>

>>
>>>
>>> Thanks,
>>> H.
>>>
>>> --
>>> Hervé Pagès
>>>
>>> Program in Computational Biology
>>> Division of Public Health Sciences
>>> Fred Hutchinson Cancer Research Center
>>> 1100 Fairview Ave. N, M2-B876
>>> P.O. Box 19024
>>> Seattle, WA 98109-1024
>>>
>>> E-mail: hpages_at_fhcrc.org
>>> Phone: (206) 667-5791
>>> Fax: (206) 667-1319
>>>
>>> ______________________________________________
>>> R-devel_at_r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>
>>
>
>
-- 
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M2-B876
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages_at_fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed 10 Nov 2010 - 18:53:50 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 10 Nov 2010 - 23:10:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive