R functions for weighted accuracy
Code originally published as supplementary material to: Rossiter, D. G., Zeng, R., & Zhang, G.-L. (2017). Accounting for taxonomic distance in accuracy assessment of soil class predictions. Geoderma, 292, 118–127. https://doi.org/10.1016/j.geoderma.2017.01.012