From wolfram@fischer-zim.ch  Wed Jan 22 18:32:02 2003
From: wolfram@fischer-zim.ch (Wolfram Fischer - Z/I/M)
Date: Wed Jan 22 18:32:02 2003
Subject: [Rd] text() does not accept data of type POSIXlt (PR#2487)
In-Reply-To: <Pine.LNX.4.44.0301221406240.4682-100000@gannet.stats>
References: <200301221353.OAA28926@pubhealth.ku.dk> <Pine.LNX.4.44.0301221406240.4682-100000@gannet.stats>
Message-ID: <20030122182450.A3678@s1x.zimnet.ch>

Thanks for your hint about POSIXt and POSIXlt.

Excuse me that I bothered you with my message.

I thought that text() is a function which is used often in 
combination with plot(). I have the opinion that it would be
helpful if such functions are harmonised as good as possible. -
Therefore I took the time to inform about my observation.

Wolfram Fischer

--- In reply to: ---
>Date:    22.01.03 14:13 (+0000)
>From:    ripley@stats.ox.ac.uk
>To:      To wolfram@fischer-zim.ch
>Subject: Re: [Rd] text() does not accept data of type POSIXlt (PR#2487)
>
> Where is the R bug here?
> 
> The dates are *NOT* `of type POSIXlt': they are of type list but
> class c("POSIXt", "POSIXlt")
> 
> plot() is a generic function with a POSIXlt method.
> text() has no POSIXt nor POSIXlt method.
> 
> Nothing says that an arbitrary function you choose will accept arbitrary 
> input, nor that plot and points, lines, text etc will have compatible 
> methods: there are dozens of exceptions.
> 
> On Wed, 22 Jan 2003 wolfram@fischer-zim.ch wrote:
> 
> > [R 1.6.1]
> > 
> > PROBLEM
> >     If text() is called with an argument of type POSIXlt,
> >     I get the following error message:
> > 
> >         "Error in as.double.default(x) :
> >         (list) object cannot be coerced to vector type 14"
> > 
> > REMARK
> >     plot() accepts this data.
> > 
> > EXAMPLE
> >     data( Lifeboats, package='vcd' )
> >     attach(Lifeboats)
> >     plot( launch, total )
> >     text( launch, total, labels=seq( along=as.vector( launch ) ) )
> >     detach(Lifeboats)
> 
> -- 
> Brian D. Ripley,                  ripley@stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] text() does not accept data of type POSIXlt (PR#2487)
Wolfram Fischer - Z/I/M