categorize: categorize()

Description Usage Arguments Value

Description

This is a helper function that recode a numeric vector into categories. by default those categories are: positive, no change, negative

Usage

1
2
categorize(vector, my_breaks = c(-Inf, 0, 1, Inf), my_labels = c("negative",
  "no change", "positive"), right = TRUE, ...)

Arguments

vector

numeric vector to be recoded

my_breaks

either a numeric vector of two or more unique cut points or a single number (greater than or equal to 2) giving the number of intervals into which x is to be cut.

my_labels

labels for the levels of the resulting category. By default, labels are constructed using "(a,b]" interval notation. If labels = FALSE, simple integer codes are returned instead of a factor.

right

logical, indicating if the intervals should be closed on the right (and open on the left) or vice versa.

...

further arguments passed to or from other methods. See cut for more information about additional arguments

Value

factor


thelayc/laycUtils documentation built on May 31, 2019, 9:17 a.m.