# Create a taxon groups object:
taxon_groups <- list(
Group_A = c("Species_1", "Species_2", "Species_3"),
Group_B = c("Species_3", "Species_4"),
Group_C = c("Species_5", "Species_6", "Species_7", "Species_8")
)
# Check that this is a valid taxonGroups object (will fail as class is not set):
is.taxonGroups(x = taxon_groups)
# Set class as taxonGroups:
class(taxon_groups) <- "taxonGroups"
# Check that this is a valid taxonGroups object (will succeed as format and
# class are correct):
is.taxonGroups(x = taxon_groups)
Run the code above in your browser using DataLab