Skip to contents

Provide grouping tags for cut

Usage

cut_label(breaks_list, openr = FALSE, digits = 0)

Arguments

breaks_list

data split points for grouping,such as c(18,30,40,50,60,70,Inf)

openr

default openright= FALSE,the data interval is in the form of left opening and right closing,such as [1,2).When openright= TRUE, the data interval is in the form of left closing and right opening.

digits

defines the number of decimal places for the return label.

Value

a grouping tags

Examples

breaks_age <- c(18,30,40,50,60,70,Inf)
cut_label(breaks_age)
#> [1] "[18,30)" "[30,40)" "[40,50)" "[50,60)" "[60,70)" "[70,+)" 
cut_label(breaks_age,2)
#> [1] "(18,30]" "(30,40]" "(40,50]" "(50,60]" "(60,70]" "(70,+]"