Using MCMC on evolutionary traits with Evomap

47 Views Asked by At

Here is what I'm running. I'm wondering why I'm getting an error and what the error means/how I could fix it. Is it something to with getting a null value for CDdat? Anyone have an idea? thanks.

library(phytools)
Loading required package: ape
Loading required package: maps

library(adephylo)
Loading required package: ade4

library(geiger)
library(nlme)
library(evomap)
library(caper)
Loading required package: MASS
Loading required package: mvtnorm

library(scales)

Attaching package: ‘scales’

The following object is masked from ‘package:geiger’:

    rescale

library(coda)
library(ggplot2); theme_set(theme_light())
library(HDInterval)

Frogtree<-read.nexus("C:/Users/WiensDell3/Desktop/TwilliamsRfiles_AdvertisementCalls/frog_contree")

Call.duration. <- read.csv("C:/Users/WiensDell3/Desktop/TwilliamsRfiles_AdvertisementCalls/Call duration .csv")

CD <- Call.duration.

mydata<-comparative.data(data= CD,phy= Frogtree, names.col= "Species")

FrogTree<- mydata$phy

mydata2 <-mydata$data

x <- mydata2$CD
BMsigma2 <- ace(x, FrogTree, method = "REML")$sigma2[1]
mvBMresults <- mvBM(x, FrogTree, BMsigma2)
tree_mvBMCD <- FrogTree; tree_mvBMCD$edge.length<-mvBMresults$rBL
CDdat<- mydata2$CD; names(CDdat <-rownames(mydata2)
+ )
NULL
Iterations <- 500000

Model_mvBMCD<-anc.Bayes(tree_mvBMCD,CDdat,ngen=Iterations)
Error in invC %*% X : requires numeric/complex matrix/vector arguments

Model_mvBMCD<-anc.Bayes(tree_mvBMCD,CDdat,ngen=Iterations)
Error in invC %*% X : requires numeric/complex matrix/vector arguments
0

There are 0 best solutions below