From Kurt.Hornik@ci.tuwien.ac.at  Fri Jul 10 17:41:45 1998
From: Kurt.Hornik@ci.tuwien.ac.at (Kurt Hornik)
Date: Fri, 10 Jul 1998 18:41:45 +0200 (CEST)
Subject: partial matches for attribute name
In-Reply-To: <98Jul10.100706edt.13457@mailgate.bank-banque-canada.ca>
References: <x2hg0pzxwi.fsf@blueberry.kubism.ku.dk>
 <98Jul10.100706edt.13457@mailgate.bank-banque-canada.ca>
Message-ID: <13734.17481.13866.883711@pc87.maho.magnaeu.com>

>>>>> Paul Gilbert writes:

>> o   attr() partial matches for attribute name.

> If this does what I think it does then I don't think it is a very good
> idea, and is also not consistent with S:

> In Splus I get
>> attr(diag(.5,3), "dim")
> [1] 3 3
>> attr(diag(.5,3), "di")
> NULL
>>

Which is clearly a bug.  The Splus documentation says,

       The semantics of attr are defined by saying  that  attr(x,
       which)  is equivalent to attributes(x)[[which]] for either
       extracting or replacing attributes, with  the  restriction
       that which is interpreted as mode character.  The value of
       attributes(x) is a list  object  (possibly  of  length  0)
       associated  implicitly  with  any object x.  See Subscript
       for the semantics of "[[".

and we have

> attributes(diag(.5,3))[["di"]]
[1] 3 3

-kh
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


partial matches for attribute name
Kurt Hornik