This PR adds a warning when combining two labelled vectors with conflicting labels, closing #667.
library(haven)
x <- labelled(1:2, c(Yes = 1, No = 2))
y <- labelled(1:2, c(Female = 1, Male = 2, Other = 3))
c(x, y)
#> Warning: `..1` and `..2` have conflicting value labels.
#> ℹ Labels for these values will be taken from `..1`.
#> x Values: 1, 2
#> <labelled<integer>[4]>
#> [1] 1 2 1 2
#>
#> Labels:
#> value label
#> 1 Yes
#> 2 No
#> 3 Other
This PR adds a warning when combining two labelled vectors with conflicting labels, closing #667.
Created on 2022-03-24 by the reprex package (v2.0.1)