rphylogenyape-phylo

Phylo correlogram in R bootstrapping error?


I am trying to create a phylo correlogram based on my data using phyloCorrelogram from the phylosignal package in order to test for presence of a phylogenetic signal. My data is in the so-called phylo4d format and is called tree.

Now, when I run phyloCorrelogram(tree), I am returned the following error:

library("phylobase")
library("ape")
library("phylosignal") # contains phyloCorrelogram()

> phyloCorrelogram(tree, ci.bs = 10, n.points = 10)
Error in boot::boot(X, function(x, z) moranTest(xr = x[z], Wr = prop.table(Wi[z,  : 
  no data in call to 'boot'

I have already done an elaborate search on the internet to look for ways how to solve this issue, but without success.

Since the dimension of the data that I am using is too large to post it here, I have posted my data in .rda format on dropbox.

Does anyone know the flaw?


Solution

  • You have no data associated to your tree. Your tree is a phylo4d object which has the "tree" information but no data attached to it. You need something like that

    library(phylobase)
    g1 <- as(geospiza_raw$tree, "phylo4")
    geodata <- geospiza_raw$data
    g2 <- phylo4d(g1, geodata)
    pc <- phyloCorrelogram(g2)