Skip to content

Commit

Permalink
Update fctr.R
Browse files Browse the repository at this point in the history
fix for gdemin#107
duplicated values in labels:
  • Loading branch information
Waschoi authored Feb 2, 2024
1 parent 668d7ba commit bead5bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/fctr.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fctr.labelled = function(x, ..., drop_unused_labels = FALSE, prepend_var_lab = T
vallab = val_lab(x)
varlab = var_lab(x)
x = unlab(x)
!anyDuplicated(vallab) || stop("duplicated values in labels: ",paste(vallab[duplicated(vallab)],collapse=" "))
#!anyDuplicated(vallab) || stop("duplicated values in labels: ",paste(vallab[duplicated(vallab)],collapse=" "))

uniqs=unique(x)
vallab = labelled_and_unlabelled(uniqs,vallab)
Expand Down Expand Up @@ -108,4 +108,4 @@ fast_factor = function (x = character(), levels, labels = levels, exclude = NA,
else paste0(labels, seq_along(levels))
class(f) <- c(if (ordered) "ordered", "factor")
f
}
}

0 comments on commit bead5bc

Please sign in to comment.