# NOT RUN {
# subsample taxa, preserving shared supertaxa
sample_n_taxa(unite_ex_data_3, 100, supertaxa = TRUE)
# subsample taxa using weights, preserving subtaxa
sample_n_taxa(unite_ex_data_3, 10, subtaxa = TRUE,
taxon_weight = ifelse(unite_rank == "g" & n_subtaxa > 3, 1, 0))
# }
Run the code above in your browser using DataCamp Workspace