0

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
Limey
  • 10,234
  • 2
  • 12
  • 32
  • Welcome to SO! Unfortunately, your code is not reproducible as we don't have access to your C drive. You maximise your chance of getting a useful answer if you provide a minimum reproducible example. [This post](https://stackoverflow.com/help/minimal-reproducible-example) may help. Also, please make an effort to format your code properly. – Limey Nov 09 '21 at 14:07
  • Limey, what does a proper code format look like? – Trent Williams Nov 09 '21 at 14:08
  • I see, it's what you edited. How do edit to that format? – Trent Williams Nov 09 '21 at 14:23
  • See [here](https://stackoverflow.com/editing-help) for formatting help. – Limey Nov 09 '21 at 14:25

0 Answers0