R/permuteGenotype.R

Defines functions permuteGenotype

Documented in permuteGenotype

permuteGenotype <-
function (dataLine, fromCol) 
{
    # if (fromCol<0 || fromCol != round(fromCol)) {
        # stop("'fromCol' must be a positive integer.")
    # }
    colNum = ncol(dataLine)
    randIndex = sample(colNum - fromCol+1)
	newDataLine=cbind(dataLine[,1:(fromCol-1),drop=FALSE],dataLine[,randIndex+fromCol-1,drop=FALSE])
	return(newDataLine)
}

Try the MCPerm package in your browser

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

MCPerm documentation built on May 29, 2017, 11:27 a.m.