Skip to content
Prev 11382 / 20628 Next

prunePed in MCMCglmm

On Tue, 4 Feb 2014, Adam Hayward wrote:

            
ISTM prunePed() doesn't work if the individual IDs are factors (numeric 
and character are OK).  With keep=FALSE, prunePed() reduces to this loop:

     nind <- length(ind.keep) + 1
     while (length(ind.keep) != nind) {
         nind <- length(ind.keep)
         ind.keep <- union(na.omit(c(unlist(pedigree[, 2:3][match(ind.keep,
             pedigree[, 1]), ]))), ind.keep)
     }
     pedigree <- pedigree[sort(match(ind.keep, pedigree[, 1])),]

which fails for factor IDs in the union of the parental IDs with the 
existing set of individual IDs. This was a bit confusing in that the
BTped example uses factor IDs.

Cheers, David Duffy.

| David Duffy (MBBS PhD)
| email: David.Duffy at qimrberghofer.edu.au  ph: INT+61+7+3362-0217 fax: -0101
| Genetic Epidemiology, QIMR Berghofer Institute of Medical Research
| 300 Herston Rd, Brisbane, Queensland 4006, Australia  GPG 4D0B994A