In a couple of recent posts (1,2) I have commented on Google search strings that (as the administrator of this blog) I can see have led users to my site. Today, a user ended up visiting the blog due to the following search string:
"randomly drop.tip in r"
by which I take it to mean they'd like to drop a random tip (or set of tips) from a "phylo" object in R.
Here's how to do it. To drop a single tip at random just type:
To drop a set of tips, say m=10 random tips, just type:
(actually, this will also work for a single tip, you just need to set m=1). Of course, if you wanted to, say, drop 30% of the taxa at random, you would just have to first compute the number of taxa to drop, m, and then apply the code above. For instance:
It's that easy!