Skip to content
Prev 28696 / 63424 Next

S4 / S3 / Sweave problem

I'm not sure what the issue being asked about here is.  The peculiar 
printing I don't see and may well be a locale issue.  (Is this UTF-8 and 
TeX has not been told so?)

The other issue is that when printing an object with attributes, there is 
no consideration of S4 classes amongst the attributes.  That was either an 
undocumented design decision or an omission.  This is different from
$tsp
[1]  1 10  1

$class
[1] "ts"

$Meta
An object of class ?TSmetax?
Slot "serIDs":
[1] "whatever"

Slot "ExtractionDate":
NULL

since although attributes are internally a pairlist and printed by a 
special C function, attributes() returns a list.

It would be fairly easy to include a branch for S4 objects, but there are 
ambuiguities still over what they are (I wrote up a set of questions over 
a year ago about this).  But it would seem fairly safe to send them to 
show() in the same circumstances that autoprinting does for apparently S4 
objects.
On Sun, 4 May 2008, Paul Gilbert wrote:

            
My guess is that it was never intended that S4 objects be used as
attributes, in the same way that one of the unanswered questions is if S4
objects should be allowed to have attributes (other than slots).