CategorizationIntervals: Construction function for CategorizationIntervals class

Description Usage Arguments Details Value See Also Examples

View source: R/CategorizationIntervals.R

Description

Construction function for CategorizationIntervals class used in categorizeByIntervals.

Usage

1
2
CategorizationIntervals(value, v_s_intervals = NULL, min = NULL,
  max = NULL, close_left = NULL, close_right = NULL, i_digits_label = 3)

Arguments

value

a vector.

v_s_intervals

a character vector. Each element must start with "[" or "(" and end with "]" or ")" and have two numeric values seperated by ",". Default NULL.

min

a numeric vector. Default NULL.

max

a numeric vector. Default NULL.

close_left

a integer vector with only values 0 or 1 or a logical vector. Default NULL.

close_right

a integer vector with only values 0 or 1 or a logical vector. Default NULL.

i_digits_label

number of digits in label created as part of the object. Default is 3.

Details

Intervals are not allowed to overlap. Either v_s_intervals is provided or min, max, close_left and close_right must be provided. CategorizationIntervals class inherits from data.table. This object type is used in categorizeByIntervals.

Value

a CategorizationIntervals object.

See Also

categorizeByIntervals

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(data.table)
ci_intervals <- CategorizationIntervals(value = c(1,2,3),
                                        min = c(-Inf, 0, 0),
                                        max = c(0 , 0, Inf),
                                        close_left = c(0,1,0),
                                        close_right = c(0,1,0) )
print(ci_intervals)
ci_intervals <- CategorizationIntervals(value = c(1,2,3),
                                        v_s_intervals = c("(-Inf,0)","[0,0]","(0,Inf)"))
print(ci_intervals)

AlejandroKantor/akmisc documentation built on May 5, 2019, 3:51 a.m.