Re: [R-sig-phylo] How to sort trait data according to tree

2021-05-17 Thread Emmanuel Paradis
- Le 17 Mai 21, à 13:41, Marguerite Butler a écrit : > Thank you very much for the reply Emmanuel! > OK, yes I just tried and Iʻm surprised that this works: >> dat <- data.frame(Species = c("Homo", "Pongo", "Macaca", "Ateles", >> "Galago"), X > > = X, Y = Y) > > cbm <- corBrownian(1,

Re: [R-sig-phylo] How to sort trait data according to tree

2021-05-17 Thread Marguerite Butler
Thank you very much for the reply Emmanuel! OK, yes I just tried and Iʻm surprised that this works: > dat <- data.frame(Species = c("Homo", "Pongo", "Macaca", "Ateles", "Galago"), X = X, Y = Y) > cbm <- corBrownian(1, tree, form = ~Species) > gls(Y ~ X, dat, correlation = cbm) How does

Re: [R-sig-phylo] How to sort trait data according to tree

2021-05-17 Thread Marguerite Butler
Emmanuel, Yes, that was exactly what I was confused about (even str(cbm) wasnʻt very illuminating). Thank you so much for your explanation. CorBrownian is only storing the formula and the tree, and the data are gathered by gls. I agree this is a very good way to keep everything in its proper

Re: [R-sig-phylo] phylogenetic correction and MCMC model

2021-05-17 Thread Jarrod Hadfield
Hi David, It looks like phylo_ultra might be a list? Is phylo_ultra[[1]] a tree? Also, don't use nodes="TIPS"; this is just to demonstrate how poor the algorithm is when you don't use the expanded inverse. I see people using nodes="TIPS" a lot - where does this code come from? Cheers, Jarrod

Re: [R-sig-phylo] phylogenetic correction and MCMC model

2021-05-17 Thread David Costantini
Hi Jarrod here are the scripts: phylo<-read.nexus("output.nex") phylo$edge.length <- phylo$edge.length[1 + .001] phylo_ultra=chronos(phylo, lambda=0) is.ultrametric(phylo_ultra) tree.unmatched <- multi2di(phylo_ultra, random=TRUE) plotTree(tree.unmatched,fsize=0.6)

[R-sig-phylo] phylogenetic correction and MCMC model

2021-05-17 Thread David Costantini
Dear All I am trying to apply a phylogenetic correction to an MCMC model, but I have problems in making the inverse matrix. I can visualise the treeplot very well, but when I use the script: inv.phylo<-inverseA(phylo_ultra,nodes="TIPS",scale=TRUE) R tells me that there is an error: Error

Re: [R-sig-phylo] phylogenetic correction and MCMC model

2021-05-17 Thread David Costantini
super! thanks David Costantini Professor of Conservation Physiology Muséum National d'Histoire Naturelle, CNRS 7 rue Cuvier 75005 Paris, France Tel.: +33.(0)1.40.79.53.74 Associate Editor Functional Ecology

Re: [R-sig-phylo] phylogenetic correction and MCMC model

2021-05-17 Thread Jarrod Hadfield
Hi, chronos adds a chronos class to the object, creating problems. Anything wrong with using: phylo<-read.nexus("output.nex") phylo<- di2multi(phylo) inv.phylo<-inverseA(phylo) ? Cheers, Jarrod On 17/05/2021 19:47, David Costantini wrote: This email was sent to you by someone outside

Re: [R-sig-phylo] phylogenetic correction and MCMC model

2021-05-17 Thread David Costantini
Hi Jarrod the new script works well, no problems with it. So I moved on trying the mcmc... R says 'some levels of animal do not have a row entry in ginverse' I suppose that the issue is that in my dataset I have species missing in the ginverse, right? Thanks again for your help d

Re: [R-sig-phylo] phylogenetic correction and MCMC model

2021-05-17 Thread Jarrod Hadfield
Hi, Yes - all species in the data frame need to be in the phylogeny (but not vice versa). Cheers, Jarrod On 17/05/2021 20:47, David Costantini wrote: This email was sent to you by someone outside the University. You should only click on links or attachments if you are certain that the