I stumbled onto this working on an update to coxph. The last 6 lines
below are the question, the rest create a test data set.
tmt585% R
R version 2.12.2 (2011-02-25)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-unknown-linux-gnu (64-bit)
# Lines of code from survival/tests/singtest.R
[1] 1 2 3 4 4 5 6 7 7 7 6 6 6 NA NA NA 6 6 6 8 8 8
6 6
-----------------------
I've solved it for my code by not calling match on a 1 column vector.
In general, however, should I be using some other paradym for this "map
to unique" operation? For example match(as.character(x),
unique(as.character(x)) ?
Terry T