Skip to content

cut_width should be able to take ... for cut.default #3055

Closed
@cderv

Description

@cderv

From a question in community.rstudio.com it seems like cut_width is the only one of the three functions to not take ... to pass it to cut.default

In particular, labels argument can not be used with cut_width. Just adding ... would allow this

> cut_width(runif(1000), 0.1, center = 0, labels= FALSE)
  [1]  2  6  9 10  8  7 11  6  6  3 11 11  5  6 10  3  4  8  8 11  2  3  5  2  3  6  8  7  4  6  7 11 10  4 10 11
 [37]  6  5  6  1  3  6  7  1  9  9  3  2  9 11  8  3  8  6 11 10  6  9  4  3  1  8  6  6  5 10  6  9  9  9  8  4
 [73] 11  2  2 10  4  8  9  3  3  3 11 11  4  2  8 11  8 10  5  7 10  2  1  2  6  3  2  2
 [ reached getOption("max.print") -- omitted 900 entries ]

or to change labels if the call (could always be done afterward using forcats)

I open the issue to reference the question and see if it worth doing. Seems quite easy to be consistent between those three cut_* helper in lubridate.

If you're interested I'll do a PR.

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