scl <- DexiDiscreteScale(values = c("low", "med", "high"))
bounded_scale_value(NA, scl) # NA
bounded_scale_value(1, scl) # 1
bounded_scale_value(4, scl) # NULL
bounded_scale_value(c(0, 1, 3, 4, 5), scl) # c(1, 3)
bounded_scale_value(distribution(0.1, 0.2, 0.3, 0.4), scl) # distribution(0.1, 0.2, 0.3)
Run the code above in your browser using DataLab