Description Usage Arguments Details Value Acknowledgements Examples
Function removing set notation used by cut
or by cut2
.
1 | pretty_cuts(cut_str, only_cuts = FALSE)
|
cut_str |
A character or factor vector produced by |
only_cuts |
A logical, defaults to |
For a factor generated by cut2
"[2057,2652)", "[2652,3092)", "..."
the function will return a character vector
"2057 - 2651", "2652 - 3091", "..."
A character vector.
The following function was referenced on Stacks Overflow on a number of occasions, in reference to obtaining nicer cuts, improving function performance and reducing small groups. The linked discussion provide a more comprehensive solutions than the function offered in this package.
1 2 | set.seed(123)
pretty_cuts(cut(x = runif(n = 1e3, min = 1, 1e4), breaks = 5))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.