## import example data
#data(genotypeData)
## get the first line: affection state for samples
# data1=genotypeData[1,,drop=FALSE]
# get the second line: genotype data for a sepcifed snp
# data2=genotypeData[2,,drop=FALSE]
# chisq.TradPerm(data2,data1,fromCol=2,naString="?_?",sep="_",repeatNum=5)
## matrix
# genotypeLine=matrix(c("rs12","AA","TT","TA","AA","TT","AA","AA"),nrow=1)
# affectionLine=matrix(c("Affection",1,1,1,0,0,0,0),nrow=1)
# chisq.TradPerm(genotypeLine,affectionLine,fromCol=2,naString="NN",sep="",repeatNum=5)
## connect file
# datafile=file("F:/data.txt","r")
## get the affection status for samples, read the first line from "data.txt"
# dataLine1=readLins(datafile,n=1)
# dataLine1=t(unlist(strsplit(dataLine1,sep="")))
## get the genotype line for samples, read the second line form "data.txt"
# dataLine2=readLines(datafile,n=1)
# dataLine2=t(unlist(strsplit(dataLine2,sep="")))
# chisq.TradPerm(dataLine2,dataLine1,fromCol=2,naString="NN",sep="",repeatNum=1000)
Run the code above in your browser using DataLab