R/simnucleotide.R

`simnucleotide` <-
function(nucleotide, brlens, qmatrix)
{
	tranprob<-expm(Matrix(qmatrix*brlens))
	new<-tranprob[nucleotide,]
	newnucleotide<-apply(new,1,function(x) sample(1:4,1,TRUE,x))
	newnucleotide
}
bomeara/phybase documentation built on May 12, 2019, 11:35 p.m.