Bug in make.unique

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bug in make.unique

Niek Bouman
The make.unique function states that the algorithm has the property that make.unique(c(A, B)) == make.unique(c(make.unique(A), B)).


This doesn't seem to be the case in all situations. An example:


A <- c("1","1")
B <- "1.1"
make.unique(c(A, B))
[1] "1"   "1.2" "1.1"
make.unique(c(make.unique(A), B))
[1] "1"     "1.1"   "1.1.1"
make.unique(c(A, B)) == make.unique(c(make.unique(A), B))
[1]  TRUE FALSE FALSE

I tested this on a couple of R versions between R 3.2.1 and R 3.5.0.

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel