Skip to contents

For quantiles, thresholds should be expressed as a character vector with each element beginning with "q" followed by the quantile expressed as a value between 0 and 1.

Usage

parse_thresholds(x)

Arguments

x

A numeric or character vector.

Value

A list with a numeric vector of thresholds and a logical indicating whether the thresholds are quantiles.

Examples

parse_thresholds(seq(1, 5))
#> $thresholds
#> [1] 1 2 3 4 5
#> 
#> $quantiles
#> [1] FALSE
#> 
parse_thresholds(paste0("q", seq(0, 1, 0.2)))
#> $thresholds
#> [1] 0.0 0.2 0.4 0.6 0.8 1.0
#> 
#> $quantiles
#> [1] TRUE
#>