Skip to content
Prev 17336 / 398513 Next

Pointer to covariates?

On Fri, 22 Feb 2002, [iso-8859-1] Göran Broström wrote:

            
Very probably. Note that the original did not paste row-by-row.  You could
use do.call.  Here's an untested variant

match(do.call("paste", c(dat[, -response, drop = FALSE], sep="\001")),
      do.call("paste", c(covar,  sep="\001")))

Note also that I used a different separator ("\r" is also possible), as
that is much more likely to make a unique string.  See
duplicated.data.frame for the use of this.