Re: [R-sig-phylo] determine multistate characters in nexus data matrix

2015-03-22 Thread Paolo Piras
Hi folks, I want to thanks all people who responded to my post; I'm testing the proposed codes and I'll let you know their efficiency the problem, apparently seems the managing of polimorphisms in the data matrix (i.e. [0,2] for the same character for a given taxon) all the best paolo

Re: [R-sig-phylo] determine multistate characters in nexus data matrix

2015-03-20 Thread Liam J. Revell
I don't know if this has already been answered, but read.nexus.data in ape automatically creates a list character vectors. To get the number of states in each character you can do: N-apply(data.frame(X),1,function(x) length(unique(x))) if your data is an object of class DNAbin then the

[R-sig-phylo] determine multistate characters in nexus data matrix

2015-03-06 Thread Paolo Piras
Hi folks, I have a nexus data matrix with n taxa and m discrete characters (including some polymorphisms); I would like to know which characters are binary and which ones are multistate. Maybe some manual coding will be sufficient but just in case...there is a function, in your knowledge,