search for: keeporderuniqu

Displaying 1 result from an estimated 1 matches for "keeporderuniqu".

Did you mean: keeporderunique
2004 Sep 29
1
Ordering of values returned by unique
...ull for some applications (e.g tree traversal), so i use it in a script. But I am a little woried if I can rely on this behaviour in further versions. And furthermore can I assume that someone reading the code will think that it works in that way? Or is it better to define a additional function? keeporderunique<-function(x) { res<-rep(NA,length(unique(x)) count<-0 for(i in x) { if(!i%in%res) { count<-count+1 res[count]<-i } } res } /E -- Dipl. bio-chem. Witold Eryk Wolski MPI-Mo...