This assumes you will have a data.frame of popularity measures and then sum to combine the columns into a single measure.
popularitree(phy, ntax, measures, pd_weighting = 0.5, nrep = 10000)
| phy | A phylo object |
|---|---|
| ntax | The final number of taxa you want |
| measures | Data.frame of the measures of popularity |
| pd_weighting | How much to weight the pd vs the popularity |
| nrep | How many replicates to use |
A phylo object pruned to the number of taxa
big.phy <- rotl::get_study("ot_308")[[1]] big.phy <- geiger::drop.random(big.phy, ape::Ntip(big.phy) - 20) measures <- tree_compute_measures(big.phy)#> #>#> #>#> #>#> #>#>#> #>#> #>#> #>#> #>#>#> #>#>#> #>#> #>#> #>#>#> #>#> #>#> #>#> #>#> #>#> #>#> #>#>#> #>#> [1] "Retrieving trends data for taxon 'Microtus_juldaschi'" #> [1] "Retrieving trends data for taxon 'Gerbillurus_setzeri'" #> [1] "Retrieving trends data for taxon 'Cricetomys_gambianus'" #> [1] "Retrieving trends data for taxon 'Spalax_giganteus'" #> [1] "Retrieving trends data for taxon 'Zygodontomys_brevicauda'" #> [1] "Retrieving trends data for taxon 'Akodon_dayi'" #> [1] "Retrieving trends data for taxon 'Oecomys_rex'" #> [1] "Retrieving trends data for taxon 'Chiropodomys_major'" #> [1] "Retrieving trends data for taxon 'Nesokia_bunnii'" #> [1] "Retrieving trends data for taxon 'Nesokia_indica'" #> [1] "Retrieving trends data for taxon 'Ctenomys_perrensis'" #> [1] "Retrieving trends data for taxon 'Petinomys_genibarbis'" #> [1] "Retrieving trends data for taxon 'Exilisciurus_concinnus'" #> [1] "Retrieving trends data for taxon 'Lepilemur_mustelinus'" #> [1] "Retrieving trends data for taxon 'Tragelaphus_eurycerus'" #> [1] "Retrieving trends data for taxon 'Viverricula_indica'" #> [1] "Retrieving trends data for taxon 'Manis_crassicaudata'" #> [1] "Retrieving trends data for taxon 'Mormoops_blainvillii'" #> [1] "Retrieving trends data for taxon 'Chalinolobus_dwyeri'" #> [1] "Retrieving trends data for taxon 'Crocidura_beatus'"small.phy <- popularitree(phy=big.phy, ntax=5, measures, nrep=100) par(mfcol=c(1,3)) plot(big.phy) plot(small.phy) plot(tree_convert_to_common(small.phy))#> #>#> #>#> #>#> #>#> #>