# NOT RUN {
data("map")
data("Cattle")
dir <- system.file("extdata", package = "optiSel")
files <- paste(dir, "/Chr", 1:2, ".phased", sep="")
sKin <- segIBD(files, map, minSNP=20, minL=2.0)
Phen <- Cattle[Cattle$Breed=="Angler", ]
cand <- candes(phen=Phen, sKin = sKin)
con <- list(ub.sKin = 0.057)
Offspring <- opticont("max.BV", cand, con, trace=FALSE)
##### Minimize inbreeding #####
Candidate <- Offspring$parent
Mating <- matings(Candidate, sKin, ub.nOff=5, maxit=50L)
Mating
attributes(Mating)$objval
#[1] 0.007270397
# }
# NOT RUN {
## This is faster but not available on all platforms:
library("Rsymphony")
Mating <- matings(Candidate, sKin, ub.nOff=5, alpha=0.13, solver=Rsymphony_solve_LP)
Mating
attributes(Mating)$objval
#[1] 0.009648924
attributes(Mating)$info
#[1] "Optimum solution found"
# }
# NOT RUN {
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab