Skip to content

Commit

Permalink
Update labels.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 bead5bc commit 8ddcb1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/labels.R
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ set_val_lab.default = function(x, value, add = FALSE){
warning("You are trying to put value labels on factor. It can lead to unexpected results. Factor will be converted to character.")
}
!is.null(names(value)) || stop("'set_val_lab' - labels should be named vector.")
!anyDuplicated(value) || stop("'set_val_lab' - duplicated values in labels: ",paste(value[duplicated(value)],collapse=" "))
#!anyDuplicated(value) || stop("'set_val_lab' - duplicated values in labels: ",paste(value[duplicated(value)],collapse=" "))

# this conversion is needed to avoid strange bug (incorrect residuals)
# with 'lm' with labelled integers
Expand Down

0 comments on commit 8ddcb1a

Please sign in to comment.