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

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Sat, 27 Oct 2007 03:48:06 -0400

On 27/10/2007 3:10 AM, John.Maindonald_at_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 - 07:55:13 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.