Imagine we're using the following code:
set.seed(42)
v <- sample(1:10, 100, T)
v <- sort(v)
unique.v <- unique(v)
Can I be sure that unique.v
is already sorted?
In a more general setting, is that true that unique()
returns a vector, ordered according to the first entry?
The documentation does not imply this, looking to the source with
?unique
getAnywhere('unique.default')
is not of a much help.