Skip to content
Prev 170191 / 398506 Next

lattice shingle with time and date format

On Tue, Feb 10, 2009 at 6:29 AM, Jon Loehrke <jloehrke at umassd.edu> wrote:
Perhaps something like

plot(breaks, xlim = as.Date(extendrange(breaks), origin = structure(0,
class = "Date")))

or the simpler

plot(breaks, xlim = extendrange(times))

(the warning seems harmless).
br.levels <- sapply(levels(breaks),
                    function(x) {
                        paste(as.character(structure(x, class = "Date")),
                              collapse = ", "))

xyplot(y~x|breaks, data=df,
       strip = strip.custom(factor.levels = br.levels,
                            strip.levels = TRUE,
                            strip.names = FALSE))

You probably want a suitable 'format' in the as.character() call.

-Deepayan