Skip to content
Prev 28714 / 63424 Next

S4 / S3 / Sweave problem

On Mon, 5 May 2008, Martin Maechler wrote:

            
But you do!  The issue is that S4 uses show() and not print(), and it was 
print() that is being called.  And the nub is
An object of class ?TSmetax?
Slot "serIDs":
[1] "whatever"

Slot "ExtractionDate":
NULL

calls show() whereas we have
<S4 Type Object>
attr(,"serIDs")
[1] "whatever"
attr(,"ExtractionDate")
`NULL`
attr(,"class")
[1] "TSmetax"
attr(,"class")attr(,"package")
[1] ".GlobalEnv"

This happens in print(zz) because printAttributes calls print() with a 
'digits' setting -- it has to because it does not know where it is called 
from.

It does seem reasonable for print(zz) to do as it did: the real problem is 
that show(zz) does not work correctly.

I've altered printAttributes in r-devel to call show() on S4 objects, but 
that does mean that arguments such as 'digits' will not be respected.
(There is potentially a problem if show() then calls print() which I have 
yet to analyse.)