thanks for your answer Zach. I tried your suggestion and it worked for the sample data I provided, but when I tried running this on my full output table (which is ~190 column and ~6700 rows), I get an error at the final command (of plotting). here is everything I run with the warnings and errors I get -
> devtools::install_github("ropensci/taxa")
> devtools::install_github("grunwaldlab/metacoder")
> library(metacoder)
> table <- read.table("all_firstbaseline_samples_allkingdom_111917.txt", sep = "\t", header = TRUE)
> parsed <- parse_tax_data(table, class_cols = "taxa", class_sep = ";")
Warning message:
Naming table columns/vectors/lists the same name as functions can sometimes interfere with non-standard evaluation. The following data shares names with functions:
data$tax_data$taxa
> parsed$data$taxon_counts <- calc_taxon_abund(parsed, "tax_data")
No `cols` specified, so using all numeric columns:
MET1074_6007_moist_Ic_R_0_U ... MET2077_6025_moist_Ic_R_0_U, MET2080_6025_moist_Pc_R_0_A
Summing per-taxon counts from 188 columns for 6688 taxa
> parsed$data$taxon_counts$total <- rowSums(parsed$data$taxon_counts[, -1])
> set.seed(2)
> heat_tree(parsed,
+ node_size = n_obs,
+ node_color = total,
+ node_label = taxon_names)
Error in if (fmin > (sfactor * fave - fmax)/(sfactor - 1)) { :
missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In FUN(X[[i]], ...) :
Could not apply layout 'reingold-tilford' to subgraph. Using 'fruchterman-reingold' instead.
2: In max(Fitness, na.rm = TRUE) :
no non-missing arguments to max; returning -Inf
3: In min(f, na.rm = TRUE) :
no non-missing arguments to min; returning Inf
4: In max(f, na.rm = TRUE) :
no non-missing arguments to max; returning -Inf
In my data I have 3 taxonomic kingdoms - bacteria, viruses and eukaryotes (fungi), if that's relevant to the parameters that should be set...
If you have any suggestion on how to work this out I would be happy to hear.
Thanks so much for your help!
Osnat