get_char_matrix_meta: Obtains taxa and character metadata from a nexml object

View source: R/nexml.R

get_char_matrix_metaR Documentation

Obtains taxa and character metadata from a nexml object

Description

Obtains taxa and character metadata from a nexml object

Usage

get_char_matrix_meta(nex)

Arguments

nex

a nexml object

Value

A list of two data frames. The first list item, id_taxa, contains a data frame with columns label, href (taxon IRI), otu (OTU ID) and otus (OTUs block ID) columns. The second list item, id_entities, contains a data frame with columns label, href (character ID), and char (character ID in NeXML document). For nexml objects obtained with get_ontotrace_data() the href column will contain the entity term IRI rather than the character ID, and the char column will contain the entity term ID (the term IRI without the HTTP path prefix).

Examples

# apply to (synthetic) Ontotrace data matrix
nex <- get_ontotrace_data(taxon = c("Ictalurus", "Ameiurus"), entity = "fin spine")
get_char_matrix_meta(nex)

# apply to data matrix from a study
slist <- get_studies(taxon = "Ictalurus australis", entity = "fin spine")
nex <- get_study_data(slist$id[1])[[1]]
metadata <- get_char_matrix_meta(nex)
# for brevity show only first 5 rows
metadata$id_taxa[1:5,]
metadata$id_entities[1:5,]


xu-hong/rphenoscape documentation built on Jan. 28, 2024, 12:22 p.m.