From murdoch.duncan at gmail.com  Tue Apr 30 13:03:50 2013
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Tue, 30 Apr 2013 07:03:50 -0400
Subject: [Rd] Subset of a 'table' divided by a 'table' is a 'table',
 but printed by 'print.default'
In-Reply-To: <CANVKczOhr5iv4=24JD93F=kF2Ze4zgN1EGMtabmgSo=o5B4T8w@mail.gmail.com>
References: <1367307525.65406.YahooMailClassic@web125103.mail.ne1.yahoo.com>
	<eba54a80f57a48799228f9b2f8798db4@EX-0-HT0.lancs.local>
	<CANVKczOhr5iv4=24JD93F=kF2Ze4zgN1EGMtabmgSo=o5B4T8w@mail.gmail.com>
Message-ID: <517FA516.7060003@gmail.com>

On 13-04-30 6:51 AM, Barry Rowlingson wrote:
> On Tue, Apr 30, 2013 at 10:49 AM, Duncan Murdoch
> <murdoch.duncan at gmail.com> wrote:
>
>> So it looks like the bug is in the implementation of "/".  Either it
>> should drop the class, or it should set the object bit.
>>
>> The difference in printing between auto-printing and explicit printing
>> may be worth addressing, but really objects like ratio shouldn't exist,
>> so it's not surprising that they behave strangely.
>
>   Also happens with *, if LHS is not a scalar:
>
>   > c(1,1)*table(x)
> x
> A B
> 2 2
> attr(,"class")
> [1] "table"
>
>   > 1*table(x)
> x
> A B
> 2 2
>
>   - similar with + and -, but not unary + and -.
>
>   Nice to see a bug in arithmetic operators that isn't covered by
> everyone screaming "FAQ 7.31!!!"

Yes :-).

I will fix it.

Duncan Murdoch



[Rd] Subset of a 'table' divided by a 'table' is a 'table', but printed by 'print.default'
Duncan Murdoch