R/lex2label.R

Defines functions lex2label

Documented in lex2label

lex2label <-
function( lex, ngam ){

    ## lex can be a vector
    
    all.lex <- allLex( ngam )

    label <- numeric( length( lex ))
    for(i in 1:length(lex))  label[i] <- which( all.lex == lex[i] )
   
    label <- label -1 ## indexing needs to start at 0
                     
    return( label ) 
}

Try the IBDLabels package in your browser

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

IBDLabels documentation built on May 2, 2019, 9:58 a.m.