Analysis of character divergence along environmental gradients and other covariates