Hi Matt,
Yea, you can plot any hierarchical data. Just think "category" when you see "taxon". Im not sure how your data is structured, but below is an example based on my best guess. Try it out and let me know if you have questions. If you have problems adapting your data, I can help if you send me your data or a subset with the same format.
Best,
Zach
library(metacoder)
# Make fake data
fish_data <- data.frame(stringsAsFactors = FALSE,
root = "data", # needed to connect years
year = rep(2012:2018, each = 3),
age = rep(c("fry", "adult", "old"), 7),
n = round(rnorm(21, mean = 100, sd = 40)))
fish_data
# Convert to taxmap format
fish_tm <- parse_tax_data(fish_data, class_cols = c("root", "year", "age"))
fish_tm
# Sum abundance per category
fish_tm$data$cat_counts <- calc_taxon_abund(fish_tm, data = "tax_data", cols = "n", out_names = "count")
fish_tm
# Plot
heat_tree(fish_tm,
node_size = count,
node_color = count,
node_label = taxon_names)