R/read.indiv.R

"read.indiv"<-function(file, skip=NA, cskip=NA){
  if(is.na(skip)){  skip <- getskip(file, quiet=TRUE)}
  if(is.na(cskip)){cskip <- getcskip(file, skip, quiet=TRUE)}
  IndivFileC <- scan(file, nlines=1, what="character",quiet=TRUE, skip=skip)
  if(cskip>0){IndivFileC <-IndivFileC[-(1:cskip)]}
  if(length(IndivFileC)==0){return(character(0))}
  if(length(IndivFileC)>=2 && IndivFileC[1]==IndivFileC[2]){
    IndivFileC <- IndivFileC[(1:length(IndivFileC))%%2==0]
  }  
  IndivFileC
}

Try the optiSel package in your browser

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

optiSel documentation built on June 22, 2024, 11:27 a.m.