Skip to content

support hms from breaks_width #244

@bhogan-mitre

Description

@bhogan-mitre

Much thanks for the new breaks_width function in response to #190. Would there be any objection to supporting its use for hms as well?

library(hms)
library(ggplot2)

df <- data.frame(hours = 1:3, hms = hms(hours = 1:3))

ggplot(df, aes(x = hours, y = hms)) + 
  scale_y_time(breaks = scales::breaks_width(900))
#> Error in UseMethod("fullseq"): no applicable method for 'fullseq' applied to an object of class "c('hms', 'difftime')"

I made a simple change in a fork to add fullseq.hms and it appears to work fine.
bhogan-mitre@70a55db I'm happy to submit as a PR if you're open to it.

Looking ahead, it would be nice to have more intuitive specification from ggplot2::scale_*_time similar to date_breaks. Although I figured I'd start here. Thanks for considering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions