ropensci / taxa

taxonomic classes for R
https://docs.ropensci.org/taxa
Other
48 stars 12 forks source link

Function to produce html/latex table of taxonomic and associated data ? #200

Open zachary-foster opened 5 years ago

zachary-foster commented 5 years ago

It would be cool to be able have a function to produce tables like this from taxmap objects for use in Rmarkdown documents and publications:

image

It could output a table produced by kableExtra with a command like the following:

tax_kable(my_taxmap_obj, 
          ranks = c("Phylum", "Class", "Order", "Family", "Genus"), 
          data = c("OTUs represented" = "otu_count", "All roots" = "root_prop", "All soils" = "soil_prop"), 
          ...)

Things like "root_prop" would be user-specific variables accessible by all_names (table columns in the taxmap object) and ... would be passed to kable or kableExtra.

sckott commented 5 years ago

cool idea! would it require a bunch of dependencies?

zachary-foster commented 5 years ago

I think it would just need knitr and kableExtra. I imagine most people would have knitr anyway, but I am not sure how many dependencies kableExtra has.

I was thinking about separating the plotting of heat trees from metacoder into a new package focused on visualization of hierarchical data, and reserving metacoder for microbiome community ecology type stuff. If not in the taxa package, this might be good in the package that heat trees go in.

sckott commented 5 years ago

that sorta makes sense i think, if you're going to break out a new pkg focusing on plotting, then might make sense to put this fxn in that pkg