Hi folks,

I have a set of trees with tip states, generated by simulation, in a multiphylo 
object. I'd like to drop trees from the list based on a criterion (some trees 
do not exhibit all three tip states).

I've tried the following (which is admittedly clumsy; I am not very familiar 
with multiPhylo lists):

trees.pool <- apply(pars, 1, function(pars) trees(pars, type="musse", n=1, 
max.taxa=250, max.t=40, include.extinct=FALSE, x0=1))
class(trees.pool) <- "multiPhylo"

# Screen these trees for ntax size, all states present:

for (i in 1:length(trees.pool)) {

if (length(unique(trees.pool[[i]]$tip.state)) < 3) {
                trees.pool[[i]] <- NULL
                } else {
                i = i+1
        }
}

but I get the error 

Error in `[[<-.multiPhylo`(`*tmp*`, i, value = NULL) : 
  trying to assign an object not of class "phylo" into an object of class 
"multiPhylo".

Any ideas?

Thanks!

~John


John S. S. Denton, Ph.D.
Department of Vertebrate Paleontology
American Museum of Natural History
www.johnssdenton.com
_______________________________________________
R-sig-phylo mailing list - [email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/[email protected]/

Reply via email to