Skip to content
Snippets Groups Projects
Commit adb81946 authored by Otto, Dr. Saskia's avatar Otto, Dr. Saskia
Browse files

changed adding constant for cases when =% and 20% percentile are the same (and...

changed adding constant for cases when =% and 20% percentile are the same (and hence br[sel] is zero)
parent 6c07b5e3
No related branches found
No related tags found
No related merge requests found
......@@ -107,7 +107,7 @@ trafficlight <- function(x, time = NULL, sort_5yrmean = TRUE, sort_vec = NULL,
br <- stats::quantile(v, probs = probs, na.rm = TRUE, type = type)
if (any(diff(br) == 0)) {
sel <- which(diff(br) == 0)
br[sel+1] <- br[sel+1] + br[sel]/10000
br[sel+1] <- br[sel+1] + 0.0001 # br[sel]/10000
print(paste0("For variable '", var, "' the ", probs[sel+1]*100,
"%-quantile is the same as the ", probs[sel]*100,
"%-quantile. All values are grouped under the lower quantile!"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment