We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
breaks_equal
It'd be useful to have a function to split a scale into breaks of equal size from the limits.
I thought maybe it might like it scales::breaks_equal(n = NULL, ....)
scales::breaks_equal(n = NULL, ....)
Below is the output that it would generate in breaks as a demo for different n's for a example limits of c(0, 10), but rounded sensibly.
x1 <- 0 x2 <- 10 n <- 2 seq(from = x1, to = x2, by = (x2 - x1) / (n - 1)) #> [1] 0 10
n <- 3 seq(from = x1, to = x2, by = (x2 - x1) / (n - 1)) #> [1] 0 5 10
n <- 4 seq(from = x1, to = x2, by = (x2 - x1) / (n - 1)) #> [1] 0.000000 3.333333 6.666667 10.000000
n <- 5 seq(from = x1, to = x2, by = (x2 - x1) / (n - 1)) #> [1] 0.0 2.5 5.0 7.5 10.0
n <- 6 seq(from = x1, to = x2, by = (x2 - x1) / (n - 1)) #> [1] 0 2 4 6 8 10
Created on 2024-06-15 with reprex v2.1.0
The text was updated successfully, but these errors were encountered:
Also, be great if this could work with Date's etc
Sorry, something went wrong.
Are you think of the seq(length.out) argument, or is it somewhat more complex than this?
seq(length.out)
No branches or pull requests
It'd be useful to have a function to split a scale into breaks of equal size from the limits.
I thought maybe it might like it
scales::breaks_equal(n = NULL, ....)
Below is the output that it would generate in breaks as a demo for different n's for a example limits of c(0, 10), but rounded sensibly.
Created on 2024-06-15 with reprex v2.1.0
The text was updated successfully, but these errors were encountered: