Code for  Schwilk, D. W. and D. D. Ackerly. 2005. Limiting similarity and functional diversity along environmental gradients. *Ecology Letters* 8:272-281.