The nexml class represents a NeXML document, and is the top of the
class hierarchy defined in this package, corresponding to the root node
of the corresponding XML document.
Details
Normally objects of this type are created by the package as a result of
reading a NeXML file, or of converting from another type, such as
ape::phylo. Also, interacting directly with the slots of the class is
normally not necessary. Instead, use the get_XXX() and add_XXX()
functions in the API.
Slots
treeslist, corresponding to the list of
<trees/>elements in NeXML. Elements will be of classtrees.characterslist, corresponding to the list of
<characters/>elements in NeXML. Elements will be of classcharacters.otuslist, corresponding to the list of
<otus/>elements in NeXML. Elements will be of classotus.aboutinherited, see Annotated
metainherited, see Annotated
xsi:typefor internal use
versionNeXML schema version, do not change
generatorname of software generating the XML
xsi:schemaLocationfor internal use, do not change
namespacesnamed character vector giving the XML namespaces
Examples
nex <- nexml() # a nexml object with no further content
nex <- new("nexml") # accomplishes the same thing
nex@generator
#> [1] "RNeXML"
length(nex@trees)
#> [1] 0
data(bird.orders)
nex <- as(bird.orders, "nexml")
summary(nex)
#> $nblocks
#> trees otus characters
#> 1 1 0
#>
#> $ncharacters
#> integer(0)
#>
#> $nstates
#> integer(0)
#>
#> $nnonstdstatedefs
#> polymorphic uncertain
#>
#> $nmatrixrows
#> integer(0)
#>
#> $ntrees
#> block.1
#> 1
#>
#> $notus
#> block.1
#> 23
#>
#> $nmeta
#> $nmeta$nexml
#> [1] 0
#>
#> $nmeta$otu
#> block.1
#> 0
#>
#> $nmeta$char
#> integer(0)
#>
#> $nmeta$state
#> integer(0)
#>
#>
length(nex@trees)
#> [1] 1