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

Duncan Murdoch murdoch at stats.uwo.ca
Sat Oct 27 09:48:06 CEST 2007


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



More information about the R-devel mailing list