Skip to content

data.tree wrapper functions #43

@brownag

Description

@brownag
  • Add {data.tree} to suggests
  • Develop a few standard path strings that can be used with standard datasets (or subsets thereof)
  • Functions for writing a formatted tree to:
    • TXT
    • HTML
    • CSV

I've noticed it's not super easy to get the trees put back out in a clean text-based format and that it would be good to extend on @dylanbeaudette old examples that were in the readme.


Here is a quick sample (modified version of second old example) based on 13th edition keys and an order->subgroup path string.

library(SoilTaxonomy)
library(data.tree)
data("ST_higher_taxa_codes_13th"package = "SoilTaxonomy")
# create ST-style dataset from higher taxa codes
ST13 <- getTaxonAtLevel(ST_higher_taxa_codes_13th$taxon,
                        level = c("order""suborder""greatgroup""subgroup"))
ST13 <- ST13[order(ST_higher_taxa_codes_13th$code),]
ST13 <- ST13[complete.cases(ST13),]
ST13$root <- "Soil Taxonomy (13th Edition)"
ST13$pathString <- with(ST13, paste0(root"/"order"/"suborder"/"greatgroup"/"subgroup))
n <- as.Node(ST13)
print(nlimit = NULL)

Ideas for output:

  • the text output appears to include some unicode markup that should be stripped out.
  • knitr::kable() and results="asis" result in less-than-ideal HTML formatting (needs fixed-width font, other styling)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions