diff --git a/instat/static/InstatObject/R/stand_alone_functions.R b/instat/static/InstatObject/R/stand_alone_functions.R index 09f224a2981..fe3bc9e6fcf 100644 --- a/instat/static/InstatObject/R/stand_alone_functions.R +++ b/instat/static/InstatObject/R/stand_alone_functions.R @@ -2556,7 +2556,9 @@ is.containValueLabel <- function(x){ is.containPartialValueLabel <- function(x) { if(is.containValueLabel(x)) { - return(!all(x[!is.na(x)] %in% attr(x, labels_label))) + levelCounts <- table(x) + return(!all(x[!is.na(x)] %in% attr(x, labels_label)) && + sum(levelCounts == 0) == 0) } else{return(FALSE)} }