Dear R-sig-phylo community, > > I'm an MA student in NY working on his thesis and am relatively new to > phytools. I have two questions. My first question concerns a methods > issue for ancestral reconstruction and my second question is a coding > issue with inputting my data. >
> *Question 1:* Ace (from Paradis et al., ape package) uses a "Felsenstein's > pruning algorithm & compute the likelihood" that may have issues for my > research and make.simmap has had known errors for the conditional > likelihoods of the root nodes - is there a recommended method for > recovering the ancestral character states for a character evolution of > > a global population? > > *Question 2:* > I'm attempting to use the make.simmap(tree, x, model="SYM", nsim=1, ...) > function > in phytools but have had difficulty in inputting my discrete character data. > > I know "x" can be a "vector containing the tip states for a discretely > valued character". > > My code in R is listed below with some thoughts on where I went wrong. I > would appreciate any advice or help to get me in the right direction. Thank > you. > > Best regards, > Fernando L. > > > *library(phytools) * > > > *tree<-read.nexus("test_tree.nexus")* > > > # Resolving polytomies in my tree in order to use ace and estimate the > ancestral state of discrete data. > > > *dichot_tree = multi2di(tree) * > > *dichot_tree$edge.length<-runif(n=nrow(dichot_tree$edge),min=0,max=1)* > > > > * dichot_tree$edge.length[dichot_tree$edge.length<1]<-1* > #My binary discrete character traits is within my nexus file > *traits = read.nexus.data("**test_tree.nexus** ")* > > *x<-as.matrix(traits)* > > # making a matrix for my data. It contains 262 species samples with > discrete binary states of 0 or 1. > > > [image: Inline image 4] > > > > # I attempt to use the make.simmap function and get the following > error. > > > *xsimm <- make.simmap(dichot_tree, x, model = "ARD")* > > *Error in xx[tree$tip.label, ] : subscript out of bounds* > > > > >
_______________________________________________ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/