powered by
find_segment() is a function for classifying theta values into segments based on supplied cutpoints.
find_segment()
find_segment(x, segment)
the theta value. This can be a vector.
segment cutpoints. Values of -Inf, Inf are not implied and must be explicitly supplied if intended.
-Inf, Inf
cuts <- c(-Inf, -2, 0, 2, Inf) find_segment(-3, cuts) find_segment(-1, cuts) find_segment(1, cuts) find_segment(3, cuts) find_segment(seq(-3, 3, 2), cuts)
Run the code above in your browser using DataLab