migrating some functions from microbiome
R