[R-sig-phylo] Function

2019-11-20 Thread ' Salatiel Clemente
Hello I need help with a function.I am analyzing air quality data, available on the platform (https://www.purpleair.com/map?opt=1/mAQI/a10/cC0#6.86/-7.215/-72.463).I will perform a historical series analysis for a state, with data from a device that measures air quality. It's 720 measurements a

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

[R-sig-phylo] Function to drop clade

2017-06-06 Thread Mario José Marques-Azevedo
Dears, I restructured the function drop.clade to work with tree with/without singletons. It return tree as it is, with/without singletons and is independent of extract.clade and drop.tip. Maybe it could be useful.

Re: [R-sig-phylo] [function like ratebystate, but for discrete characters?]

2016-05-04 Thread Brian O'Meara
I hope that was clear... Thank you very much! > , Michael Foisy > > MSc. Student > University of Toronto > michael.fo...@mail.utoronto.ca > > From: Liam J. Revell <liam.rev...@umb.edu> > Sent: Tuesday, May 3, 2016 8:11:39 PM &

Re: [R-sig-phylo] [function like ratebystate, but for discrete characters?]

2016-05-03 Thread Jacob Berv
Also see BayesTraits for the bayesian version. Jake > On May 3, 2016, at 8:11 PM, Liam J. Revell wrote: > > Hi Michael. > > This is essentially the method of Pagel (1994). Though often interpreted as a > test for correlated evolution of two binary characters, the model

Re: [R-sig-phylo] [function like ratebystate, but for discrete characters?]

2016-05-03 Thread Michael Foisy
Liam J. Revell <liam.rev...@umb.edu> Sent: Tuesday, May 3, 2016 8:11:39 PM To: Michael Foisy; r-sig-phylo@r-project.org Subject: Re: [R-sig-phylo] [function like ratebystate, but for discrete characters?] Hi Michael. This is essentially the method of Pagel (1994). Though often interpreted as

Re: [R-sig-phylo] [function like ratebystate, but for discrete characters?]

2016-05-03 Thread Liam J. Revell
Hi Michael. This is essentially the method of Pagel (1994). Though often interpreted as a test for correlated evolution of two binary characters, the model that is actually being fit is one in which the rate of transition 0->1 (or vice versa) in character A is affected by the state of binary

[R-sig-phylo] [function like ratebystate, but for discrete characters?]

2016-05-03 Thread Michael Foisy
Hello, Quick question. I'm interested in whether the presence/absence of character 'A' affects the rate of evolution in character 'B'. Is there a function that will do this for two or more discrete characters? I've seen ratebystate {phytools} for continuous data; but my data are all binary!

[R-sig-phylo] Function match.phylo.data turns all variables in data frame into factors!

2012-03-22 Thread Roger Close
Hi all, I'm using the picante function match.phylo.data on a data frame containing a mix of numeric variables, one character and one factor, like this: phylo.data - match.phylo.data(tree, data[c(variable.a, # numeric variable.b, # numeric variable.c, # numeric variable.d, # factor

Re: [R-sig-phylo] Function match.phylo.data turns all variables in data frame into factors!

2012-03-22 Thread Steven Kembel
Hi Roger, Manipulating data.frames with mixed character, numeric, and factor columns can be tricky. Here are some good discussions of the issues and some potential solutions: http://stackoverflow.com/questions/2288485/how-to-convert-a-data-frame-column-to-numeric-type

Re: [R-sig-phylo] function to insert missing tips in a clade

2012-01-19 Thread François Michonneau
Hi Robin, Please find below a function I wrote that does what you want. Let me know if you have any questions, if you find any bugs or if you have any suggestions to make it better. Cheers,    -- François ##' Graft unsampled taxa onto a tree by simulating random trees. ##' ##' Based on a

Re: [R-sig-phylo] function to insert missing tips in a clade

2012-01-19 Thread Matt Pennell
Hi Robin (and others) I am not sure what sorts of analyses you plan on doing but you might want to look into some recent work by Helene Morlon and colleagues. She has recently published two different approaches (2010 Plos Biology; 2011 PNAS) to diversification rate which can fit birth-death (and