Repository navigation
Replies: 1 comment
|
Hi David, psq <- ps %>%
randomly select 30 taxa from the 50 most abundant taxa (just for an example)set.seed(123) draw the heatmapcor_heatmap( |
|
Hi David, psq <- ps %>%
randomly select 30 taxa from the 50 most abundant taxa (just for an example)set.seed(123) draw the heatmapcor_heatmap( |
Uh oh!
There was an error while loading. Please reload this page.
Hi David,
Thanks for developing a handy package, "microViz". I'm not a proficient R expert and have struggled to get a Spearman correlation heatmap for the top 20 taxa (Genus/Species). I was able to create a correlation heatmap for "order level" using the code below; however, when I changed to the Genus level, it was so messy because of too many genera. Can I select the top 20 genera or species for this correlation heat map? If so, please let me know what code I can use in this case. I would greatly appreciate your help. Thanks.
ps_microviz <- ps %>%
ps_mutate(
C = if_else(Group == "Center", true = 1L, false = 0L),
S = if_else(Group == "South", true = 1L, false = 0L),
N = if_else(Group == "North", true = 1L, false = 0L),
E = if_else(Group == "East", true = 1L, false = 0L),
W = if_else(Group == "West", true = 1L, false = 0L)
)
taxa_cor_heatmap <- ps_microviz%>%
tax_agg("Order") %>%
tax_transform(trans = "hellinger", rank = "Order") %>%
tax_filter(min_prevalence = 5) %>%
cor_heatmap(
colors = heat_palette(palette = "Blue-Red 3"),
vars = c("C", "S", "N", "E", "W"),
cor = "spearman"
)
All reactions