# create a genotype object (usually done by reading a file)
mysamples <- c("ind1", "ind2", "ind3", "ind4")
myloci <- c("loc1", "loc2")
mygendata <- array(list(-9), dim=c(4,2), dimnames=list(mysamples, myloci))
mygendata[,"loc1"] <- list(c(202,204), c(204), c(200,206,208,212),
c(198,204,208))
mygendata[,"loc2"] <- list(c(78,81,84), c(75,90,93,96,99), c(87), c(-9))
# write a GeneMapper file
write.GeneMapper(mygendata, "exampleGMoutput.txt")
# view the file with read.table
read.table("exampleGMoutput.txt", sep="t", header=TRUE)
Run the code above in your browser using DataLab