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)

Arguments

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

Value

A phylo object pruned to the number of taxa

Examples

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)
#> #> Retrieving data for taxon 'Microtus_juldaschi'
#> #> Retrieving data for taxon 'Gerbillurus_setzeri'
#> #> Retrieving data for taxon 'Cricetomys_gambianus'
#> #> Retrieving data for taxon 'Spalax_giganteus'
#> Not found. Consider checking the spelling or alternate classification
#> #> Retrieving data for taxon 'Zygodontomys_brevicauda'
#> #> Retrieving data for taxon 'Akodon_dayi'
#> #> Retrieving data for taxon 'Oecomys_rex'
#> #> Retrieving data for taxon 'Chiropodomys_major'
#> Not found. Consider checking the spelling or alternate classification
#> #> Retrieving data for taxon 'Nesokia_bunnii'
#> Not found. Consider checking the spelling or alternate classification
#> #> Retrieving data for taxon 'Nesokia_indica'
#> #> Retrieving data for taxon 'Ctenomys_perrensis'
#> #> Retrieving data for taxon 'Petinomys_genibarbis'
#> Not found. Consider checking the spelling or alternate classification
#> #> Retrieving data for taxon 'Exilisciurus_concinnus'
#> #> Retrieving data for taxon 'Lepilemur_mustelinus'
#> #> Retrieving data for taxon 'Tragelaphus_eurycerus'
#> #> Retrieving data for taxon 'Viverricula_indica'
#> #> Retrieving data for taxon 'Manis_crassicaudata'
#> #> Retrieving data for taxon 'Mormoops_blainvillii'
#> #> Retrieving data for taxon 'Chalinolobus_dwyeri'
#> Not found. Consider checking the spelling or alternate classification
#> #> Retrieving data for taxon 'Crocidura_beatus'
#> [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))
#> #> Retrieving data for taxon 'Nesokia_indica'
#> #> Retrieving data for taxon 'Lepilemur_mustelinus'
#> #> Retrieving data for taxon 'Viverricula_indica'
#> #> Retrieving data for taxon 'Mormoops_blainvillii'
#> #> Retrieving data for taxon 'Crocidura_beatus'