Learn R Programming

modellingTools (version 0.1.0)

get_vector_cutpoints: Get the cutpoints from a single factor vector.

Description

get_vector_cutpoints returns a numeric vector giving the unique cutpoints of a variable that has been discretized using vector_bin- more generally, using cut and any functions that depend on cut

Usage

get_vector_cutpoints(v)

Arguments

v
vector to get cutpoints from

Value

a vector containing the unique cutpoints in v

Details

This function is provided for convienience, and is built to work with the exact format for discretized variables that is used by the cut family. Hence it will work for cut, cut_number/cut_interval, and any of the binning functions from modellingTools, but it is not guaranteed to work for arbitrary factors with numeric levels

See Also

cut, cut_number, cut_interval, vector_bin

Other discretization: binned_data_cutpoints, simple_bin, vector_bin

Examples

Run this code
x <- cut(rnorm(100),c(-1,0,1))
get_vector_cutpoints(x) # -1, 0, 1

Run the code above in your browser using DataLab