# subsample taxa, preserving shared supertaxa
sample_frac_taxa(unite_ex_data_3, 0.1, supertaxa = TRUE)
# subsample taxa using weights, preserving subtaxa
sample_frac_taxa(unite_ex_data_3, 0.01, subtaxa = TRUE,
taxon_weight = ifelse(unite_rank == "g" & n_subtaxa > 3, 1, 0))
Run the code above in your browser using DataCamp Workspace