Skip to content

scale compatibility with hms class #1752

Closed
@alistaire47

Description

@alistaire47

As hms has officially become part of the tidyverse, could we get a scale_x_time (and similar) so it can be plotted directly instead of hacking it through POSIXct?

For example, right now

ggplot(data.frame(time = hms::as.hms('11:11:11'), y = 1), aes(time, y)) + geom_point()

warns

Don't know how to automatically pick scale for object of type hms/difftime. Defaulting to continuous.

but plots

rplot

chron::times similarly defaults to continuous, albeit with different numbers (due to the way the data is stored, I assume). While both can be hacked through as datetimes or relabeled, the advent of hms seems to indicate the time has come for a proper set of scale_*_time functions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions