Skip to content

Range functions should be exported #2710

Closed

Description

@clauswilke

I think the functions in https://github.com/tidyverse/ggplot2/blob/master/R/range.r should be exported. They are needed by anybody who wants to write their own scale functions from scratch.

Possibly they would fit better into the scales package, but since they depend on ggproto there's a dependency problem.

Activity

  1. hadley commented on Jun 22, 2018

    @hadley
    Member

    I think we could easily rewrite to remove the dependency issue.

  2. dpseidel commented on Jul 17, 2018

    @dpseidel
    Collaborator
  3. clauswilke commented on Jul 18, 2018

    @clauswilke
    MemberAuthor

    Indeed, looks like that is the case already. Is there any reason why ggplot2 shouldn’t just use those?

  4. hadley commented on Aug 7, 2018

    @hadley
    Member

    I guess we forgot?

    @dpseidel do you want to do a PR?

  5. dpseidel commented on Aug 7, 2018

    @dpseidel
    Collaborator

    Sure thing. I'll work one up this week.

  6. self-assigned this
    on Aug 7, 2018
  7. dpseidel commented on Aug 9, 2018

    @dpseidel
    Collaborator

    @clauswilke, unfortunately once I took a proper look, I realized the range functions in scales were not ready for primetime. I've just opened a PR in scales to fix them in the dev version but since scales 1.0.0 hit CRAN this morning, to avoid major headaches, bringing these into ggplot2 will need to wait until after the next scales release whenever that is.

  8. paleolimbot commented on Jun 25, 2019

    @paleolimbot
    Member

    @dpseidel Are the range functions now safe to use for ggplot2?

  9. dpseidel commented on Jun 25, 2019

    @dpseidel
    Collaborator

    The situation remains the same: the range functions are fixed in the dev version of scales but we have not had a new release. Now that my dissertation is (all but) finished, I've been meaning to give scales some more attention. Perhaps we can try for a release by end of summer and get this fixed.

  10. karawoo commented on Jun 24, 2020

    @karawoo
    Member

    It looks like this should be ready now that scales 1.1.0 was released last fall, @dpseidel is that right?

  11. dpseidel commented on Jun 25, 2020

    @dpseidel
    Collaborator

    @karawoo Should be! The updated range functions were released with scales 1.1.0

  12. dpseidel commented on Jun 25, 2020

    @dpseidel
    Collaborator

    @karawoo Tried to build a PR for this just now and am kicking myself because I've discovered scales::DiscreteRange does not currently support the na.rm argument to train_discrete which is critical. I will open a PR to scales now.

    In lieu of waiting for a new scales release to make this switch, we could still eliminate the ggproto dependencies now but we will need to include a custom DiscreteRange object with the correct train function. I've made and tested that change here.

    Is it a priority to make this switch now? Or should we continue to wait for this to be completely patched in scales?

  13. clauswilke commented on Jun 25, 2020

    @clauswilke
    MemberAuthor

    How about making ggplot2 temporarily dependent on the development version of scales? In this way, we can properly test that the two packages work together as expected.

  14. thomasp85 commented on Jun 25, 2020

    @thomasp85
    Member

    I think that is fine. We are a long way from any release right now

  15. karawoo commented on Jun 25, 2020

    @karawoo
    Member

    Works for me. I also don't think it's a huge priority to make the switch now, I just happened to see this issue was still open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions