Re: [Rd] Unwanted axis labels when rug() has POSIXlt argument (PR#10380)

From: John Maindonald <John.Maindonald_at_anu.edu.au>
Date: Sat, 27 Oct 2007 18:09:59 +1000

Yes, I noticed after I had sent it that x was said to be numeric.

Incidentally, this does not happen, in my experience, with Date objects.

John Maindonald email: john.maindonald_at_anu.edu.au phone : +61 2 (6125)3473 fax : +61 2(6125)5549 Centre for Mathematics & Its Applications, Room 1194, John Dedman Mathematical Sciences Building (Building 27) Australian National University, Canberra ACT 0200.

On 27 Oct 2007, at 5:48 PM, Duncan Murdoch wrote:

> On 27/10/2007 3:10 AM, John.Maindonald@anu.edu.au wrote:
>> rug() may add integer axis labels when called with a POSIXlt object
>> as argument.
>> dtimes <- c("09/29/2007 12:54", "09/30/2007 00:14",
>> "10/01/2007 00:14",
>> "10/02/2007 00:14", "10/03/2007 00:14",
>> "10/04/2007 00:14",
>> "10/05/2007 00:14", "10/06/2007 00:14",
>> "10/07/2007 00:14",
>> "10/08/2007 00:14")
>> z <- strptime(dtimes, "%m/%d/%Y %H:%M", tz="EST5EDT")
>> plot(z, rnorm(10))
>> rug(z)
>> This happens also undo Windows, both with 2.6.0 and 2.7.0
>> (2007-10-26 r43284)
>
> rug() is documented to require a numeric vector as input, and z
> isn't one of those, so there's an argument that this is user
> error. Still, its behaviour is a little surprising.
>
> The workaround is to use rug(as.numeric(z)).
>
> Duncan Murdoch
>
>> --please do not edit the information below--
>> Version:
>> platform = i386-apple-darwin8.10.1
>> arch = i386
>> os = darwin8.10.1
>> system = i386, darwin8.10.1
>> status =
>> major = 2
>> minor = 6.0
>> year = 2007
>> month = 10
>> day = 03
>> svn rev = 43063
>> language = R
>> version.string = R version 2.6.0 (2007-10-03)
>> Locale:
>> C
>> Search Path:
>> .GlobalEnv, package:stats, package:graphics, package:grDevices,
>> package:utils, package:datasets, package:methods, Autoloads,
>> package:base
>> John Maindonald email: john.maindonald_at_anu.edu.au
>> phone : +61 2 (6125)3473 fax : +61 2(6125)5549
>> Centre for Mathematics & Its Applications, Room 1194,
>> John Dedman Mathematical Sciences Building (Building 27)
>> Australian National University, Canberra ACT 0200.
>> ______________________________________________
>> R-devel_at_r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat 27 Oct 2007 - 08:14:39 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 30 Oct 2007 - 03:46:12 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.