Running examples in ‘optiSel-Ex.R’ failed
The error most likely occurred in:

> ### Name: opticont
> ### Title: Computation of optimum genetic contributions for the breeding
> ###   animals
> ### Aliases: opticont
> 
> ### ** Examples
> 
> data(Kin)  #see ?kin for creating this object
> data(Phen)
> Phen[1:5,]
                          Indiv Sex         BV        MC
276000891974272 276000891974272   1  2.3306090 1.0000000
276000891730313 276000891730313   1  3.1646864 1.0000000
276000892212506 276000892212506   1  0.9987306 1.0000000
276000891862786 276000891862786   1 -2.4614026 0.3835449
276000812497289 276000812497289   1 -0.2350507 0.2558594
> 
> ########################################
> #  Check available objective functions #
> #  and constraints                     #
> ########################################
> 
> help.opticont(Kin, Phen)
Available objective functions for opticont: 
       min.fA  min.fB  min.fN  min.fD  
       min.BV  min.MC  
       max.BV  max.MC  

Available constraints for opticont: 
       ub.fA  ub.fB  ub.fN  ub.fD  
       lb.BV  lb.MC  
       ub.BV  ub.MC  
       eq.BV  eq.MC  
       ub  lb

Attention: Probably not all these objective functions and
           constraints make sense in animal breeding

> 
> #########################
> #   Check data          #
> #########################
> 
> plot(Phen$MC, Phen$BV)
> points(Phen$MC[Phen$Sex==1], Phen$BV[Phen$Sex==1], col="red", pch=18)
> 
> #################################################################
> #       Compute the mean kinship fA that would be achieved      #
> #          in the offspring without selection                   #
> #################################################################
> con     <- list(ub=c(M=-1, F=-1))
> noSel   <- opticont(K=Kin, phen=Phen, con=con)
Objective: minimizing mean kinship fA in the offspring.
Constraints:
  Minimum contribution of males to offspring is 0.
  Minimum contribution of females to offspring is 0.
  All males have equal contributions to the offspring.
    (This implies that no optimization is done for the males).
  All females have equal contributions to the offspring.
    (This implies that no optimization is done for the females).
  The total genetic contribution of   males to offspring is 0.5.
  The total genetic contribution of females to offspring is 0.5.
> noSel.s <- summary(noSel)
Checking constraints:
  min(oc) >= 0           : TRUE
  total male cont   = 0.5: TRUE
  total female cont = 0.5: TRUE
  males have equal cont  : TRUE
  females have equal cont: TRUE
 
> noSel.s$fA
[1] 0.02284205
> # 0.02284205
> #===============================================================#
> # => Allow the kinship in the next generation                   #
> #    to be slightly larger, e.g. 0.03                           #
> #===============================================================#
> 
> 
> ##################################################################
> #                   Compute the genetic progress                 #
> #            achievable while constraining only fA               #
> ##################################################################
> con     <- list(ub.fA=0.03, ub=c(M=NA, F=-1))
> maxBV   <- opticont("max.BV", K=Kin, phen=Phen, con=con, trace = FALSE)
Objective: maximizing mean BV of the offspring.
Constraints:
  Mean kinship fA in the offspring is not exceeding 0.03.
  Minimum contribution of males to offspring is 0.
  Minimum contribution of females to offspring is 0.
  Number of offspring of males is not limited.
    (This implies that the maximum contribution per male to the offspring is 0.5).
  All females have equal contributions to the offspring.
    (This implies that no optimization is done for the females).
  The total genetic contribution of   males to offspring is 0.5.
  The total genetic contribution of females to offspring is 0.5.

Using solver cccp with parameters: trace=0, abstol=1e-05, feastol=1e-05, stepadj=0.9, maxiters=100, reltol=1e-06, beta=0.5


error: copy into submatrix: incompatible matrix dimensions: 1x1 and 2x1Error in cpd$cps(ctrl) : 
  copy into submatrix: incompatible matrix dimensions: 1x1 and 2x1
Calls: opticont ... getx -> cccp -> cps -> cps -> <Anonymous> -> .External
Execution halted