Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include.lowest missing in function arguments of cut_interval et.al. #2197

Closed
dpprdan opened this issue Jul 11, 2017 · 0 comments
Closed

include.lowest missing in function arguments of cut_interval et.al. #2197

dpprdan opened this issue Jul 11, 2017 · 0 comments

Comments

@dpprdan
Copy link

dpprdan commented Jul 11, 2017

The documentation for cut_interval reads

...   other arguments passed on to base::cut

One of the arguments of base::cut is include.lowest, but using it with cut_interval/cut_number/cut_width results in an error.

table(ggplot2::cut_interval(runif(1000), 10, include.lowest = FALSE))
#> Error in cut.default(x, breaks(x, "width", n, length), include.lowest = TRUE, :  formal argument "include.lowest" matched by multiple actual arguments

So either include.lowest = TRUE should be included in the main function arguments of cut_interval et.al., e.g. cut_number(x, n = NULL, include.lowest = TRUE, ...) This is to be preferred IMHO since it makes it's use transparent. Or the documentation should be transparent about include.lowest not being allowed.

BTW: Shouldn't these functions rather be part of scales, since both these functions and scales are about transforming variables?

@lock lock bot locked as resolved and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants