Load the BreedingSchemeLanguage.

library(BreedingSchemeLanguage)

Avoid writing over a previously existing simulation environment

if (exists("simEnv")){
  rm(list=names(simEnv), envir=simEnv)
  rm(simEnv)
}

Find the path to the HapMap file in the package

filePathName <- system.file("extdata", "exampleHapMapFile.hmp", package = "BreedingSchemeLanguage")
## locus alleles chrom pos col5 col6 effectID actionType effects col10 col11 ind1 ind2 ... 
## locus1 A/G 1 0.77 NA NA NA NA NA NA NA AA AG AA AA AA AA AA GA AA AA AA AG GA AA AA ... 
## locus2 T/G 1 1.79 NA NA NA NA NA NA NA GG GG GG TG GG TG GG GG GG GT GT GG GT GT GT ... 
## locus3 G/T 1 1.99 NA NA NA NA NA NA NA TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT ... 
## locus4 G/T 1 2.29 NA NA NA NA NA NA NA GG GG GG TG TG GG TG TG TG TG TT TT GG TG GT ... 
## locus5 G/C 1 3.1 NA NA NA NA NA NA NA GG GG GG GG GG GG GG CG GG GG GG GG GG GG GG  ... 
## locus6 G/C 1 4.29 NA NA NA NA NA NA NA GG GG GG GG GG GG GG CG GG GG GG GG GG GG GG ... 
## locus7 A/G 1 4.53 NA NA NA NA NA NA NA GA AA AG AA GA GA GG GG AA AG AG AA GA GA GA ... 
## locus8 C/T 1 5.61 NA NA 17 0 -1.311 NA NA TT TT TT TT CT TT TT TT CT TC TT TT TT TT ... 
## locus9 T/G 1 5.86 NA NA NA NA NA NA NA TT GT TG TT TT TT GT TT TT GT TT TT GT GT GG ... 
##  ...

Load the historical haplotypes into the simulation environment

simEnv <- defineSpecies(loadData=NULL, importFounderHap=filePathName, nChr=5, lengthChr=100, nMarkers=300)
initializePopulation()

Run selection on founders

phenotype()
genotype()
predictValue()
select(nSelect=50)
cross(equalContribution=T)

Intense selection on genomic predictions

genotype()
predictValue()
select(nSelect=5)
cross()
cycleMeans <- plotData()