R/createGroups.R

Defines functions createGroups

Documented in createGroups

# Version: 28-06-2013, DF

# Function tested on 28-06-2013, DF

  createGroups <- function(g, desOrder){
    reG <- g
    if(!is.numeric(g))g <- match(g, names(table(g)))
    desOrder <- desOrder
    curClass <- 1
    for(i in 1:length(desOrder))
    {
      tempPos <- g==desOrder[i]
      reG[tempPos] <- curClass
      curClass <- curClass + 1
    }
    as.numeric(reG)
  }  # end of function createGroups

#-----------------------------------------------------------------------------------------------------------------

Try the gMWT package in your browser

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

gMWT documentation built on Oct. 29, 2022, 1:14 a.m.