The effect of environmental variation on species functional traits