Re: [R-sig-phylo] Function to Extend Tips?

2017-07-26 Thread William Gearty
Awesome, thanks Joseph! On Wed, Jul 26, 2017 at 9:10 AM, Joseph W. Brown wrote: > I think this'll work, depending on how you store your data. > > # assumes a tree 'phy' and a dataframe, 'df', with first column of tip > names, and second column of values > for (i in

Re: [R-sig-phylo] Function to Extend Tips?

2017-07-26 Thread Joseph W. Brown
I think this'll work, depending on how you store your data. # assumes a tree 'phy' and a dataframe, 'df', with first column of tip names, and second column of values for (i in 1:dim(df)[1]) { # find index of edge length idx <- which(phy$edge[,2] == which(phy$tip.label ==

Re: [R-sig-phylo] Function to Extend Tips?

2017-07-26 Thread William Gearty
That's definitely helpful, Joseph, but I'll need to extend the tips to varying amounts. Basically, I performed a tip-dating analysis using constraints based on the FADs of a bunch of fossils. However, now some of the analyses I want to perform require that the tips extend to the species'

Re: [R-sig-phylo] Function to Extend Tips?

2017-07-26 Thread Joseph W. Brown
If you want to just extend all tips by a constant amount you can do this: # extend terminal edges by arbitrary amount (here: 13) idx <- which(phy$edge[,2] < (phy$Nnode + 1)); phy$edge.length[idx] <- phy$edge.length[idx] + 13; HTH. Joseph. Joseph W. Brown

[R-sig-phylo] Function to Extend Tips?

2017-07-21 Thread William Gearty
Hi all, Before I go ahead and wrote a whole script, I was wondering if there is a function or script out there for extending tips (or setting the ages of tips) given a list of taxa and ages? I haven't found anything, but perhaps I'm searching the wrong phrase(s). Thanks, Will -- William Gearty