# \donttest{
# Assign plankton groups to a list of species names
try(result <- assign_phytoplankton_group(
scientific_names = c("Tripos fusus", "Diatoma", "Nodularia spumigena", "Octactis speculum"),
verbose = FALSE))
if (exists("result")) print(result)
# Improve classification by explicitly providing Aphia IDs for ambiguous taxa
# Actinocyclus and Navicula are names shared by both diatoms and animals,
# which can lead to incorrect group assignment without an Aphia ID
try(result <- assign_phytoplankton_group(
scientific_names = c("Actinocyclus", "Navicula", "Nodularia spumigena", "Tripos fusus"),
aphia_ids = c(148944, 149142, NA, NA),
verbose = FALSE))
if (exists("result")) print(result)
# Assign plankton groups using additional custom grouping
custom_groups <- list(
Cryptophytes = list(class = "Cryptophyceae"),
Ciliates = list(phylum = "Ciliophora")
)
# Assign with custom groups
try(result_custom <- assign_phytoplankton_group(
scientific_names = c("Teleaulax amphioxeia", "Mesodinium rubrum", "Dinophysis acuta"),
aphia_ids = c(106306, 232069, 109604),
custom_groups = custom_groups, # Adding custom groups
verbose = FALSE
))
if (exists("result_custom")) print(result_custom)
# }
Run the code above in your browser using DataLab