R/binaries.R

Defines functions binaries

Documented in binaries

binaries <-
function(x) {
  levels <- unique(x)
  bnryx <- NULL
  for (z in levels) {
    bn <- rep(0,length(x)); bn[x==z] = 1
    bnryx <- cbind(bnryx,bn)
  }
  colnames(bnryx) <- paste0("v.",levels)
  return(bnryx)
}

Try the lmreg package in your browser

Any scripts or data that you put into this service are public.

lmreg documentation built on May 2, 2019, 9:29 a.m.