-
Notifications
You must be signed in to change notification settings - Fork 3
/
advantages.Rmd
27 lines (18 loc) · 1.06 KB
/
advantages.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Advantages
Here are some advantages of santoku:
* By default, `chop()` always covers the whole range of the data, so you
won't get unexpected `NA` values.
* `chop()` can handle single values as well as intervals. For example,
`chop(x, breaks = c(1, 2, 2, 3))` will create a separate factor level for
values exactly equal to 2.
* `chop()` can handle many kinds of data, including numbers, dates and
times, and [units](https://r-quantities.github.io/units/).
* `chop_*` functions create intervals in many ways, using quantiles of the data,
standard deviations, fixed-width intervals, equal-sized groups, or
pretty intervals for use in graphs.
* It's easy to label intervals: use names for your breaks vector, or
use a `lbl_*` function to create interval notation like `[1, 2)`, dash
notation like `1-2`, or arbitrary styles using `glue::glue()`.
* `tab_*` functions quickly chop data, then tabulate it.
These advantages make santoku especially useful for exploratory analysis,
where you may not know the range of your data in advance.