quantileCut: quantileCut cuts a numeric vector into the a prespecified...

Description Usage Arguments Value Examples

View source: R/quantileCut.R

Description

This function is useful for breaking up data into equal unique parts

Usage

1
2
3
4
5
6
7
8
quantileCut(
  x,
  number_breaks = 10,
  force_unique = TRUE,
  silent = TRUE,
  na.rm = FALSE,
  ...
)

Arguments

x

a numeric vector

number_breaks

how many groups should there be

force_unique

should you make sure the breaks are unique?

silent

will not warn if breaks aren't unique

na.rm

will na's be removed?

...

passed to cut

Value

a factor (result of cut)

Examples

1
2
3
4
5
6
7
8
library(dplyr)
tibble(original = rnorm(999)) %>%
  mutate(grouped = quantileCut(original)) %>%
  group_by(grouped) %>%
  summarise(MEAN = mean(original),
            MEDIAN = median(original),
            SD = sd(original),
            CT = n())

West-End-Statistics/r-library-vakdr documentation built on Dec. 18, 2021, 7:16 p.m.