Skip to content

misleading error message thrown by cut_interval() #4460

@djnavarro

Description

@djnavarro

cut_interval() throws a misleading error message when the user does not specify exactly one of n or length. In the worst case, if the user supplies width instead of length (as they would for cut_width(), you get a very fun error 😀

ggplot2::cut_interval(x = 1:10, width = 10)
#> Error: Specify exactly one of n and width

Created on 2021-05-03 by the reprex package (v0.3.0)

The error gets thrown by breaks() here. Looks like an easy fix. Happy to send a PR if you don't want to bother doing it yourself 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    messagesrequests for improvements to error, warning, or feedback messagestidy-dev-day 🤓Tidyverse Developer Day

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions