Skip to content

Compare method needed between Duration and numerics for plotting in ggplot2  #695

Closed

Description

@dpseidel

Plotting Duration objects in ggplot2 fails because there is no defined Compare method between numeric and Duration objects which is required by the underlying continuous scale calculations (reprex and discussion @ tidyverse/ggplot2#2414).

Is there a good reason why this method hasn't been implemented? I'm happy to submit a PR adding it if deemed appropriate.

Activity

  1. vspinu commented on Jul 19, 2018

    @vspinu
    Member

    No good reason. difftime works with numeric so should durations. Would appreciate a PR for this (with a news entry). Thanks!

  2. added a commit that references this issue on Jul 19, 2018
    b6d75b8
  3. added a commit that references this issue on Jul 21, 2018
    84dbcb0
  4. mrucker commented on Apr 3, 2020

    @mrucker

    FYI, for anybody who runs into this bug as of April 2020 this fix still hasn't been released even though the issue is closed. Hopefully this will save others from spending a lot of time scratching their heads.

  5. added a commit that references this issue on May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions