findLevel: Find level given minimum threshold

Description Usage Arguments Value Examples

View source: R/findLevel.R

Description

findLevel is a wrapper for the findInterval function in base R. Given a vector of results x, and a set of thresholds t1..tn, it returns a vector of levels with the same length as x, with levels 1 to n+1. The lowest level is 1, and any result acheiving >=t1 is given level 2, any result acheiving >=t2 is given level 3 and so on.

Usage

1
findLevel(x, thresh)

Arguments

x

A vector of results to classify.

thresh

A vector of minimum level thresholds, sorted increasingly.

Value

vector of length length(x) with values 1:(N+1).

Examples

1
2
3
x <- 1:100
 thresh <- c(10, 20, 50)
 findLevel(x, thresh)

multiphrenic/IncentiveAnalysis documentation built on May 23, 2019, 8:22 a.m.