xml.Extract.NM.Matrix: XML parser for matrices

View source: R/xml.Extract.NM.Matrix.r

xml.Extract.NM.MatrixR Documentation

XML parser for matrices

Description

Extract XML content into a Numeric Matrix

Usage

xml.Extract.NM.Matrix(y)

Arguments

y

XML children

Value

A matrix

See Also

nm.extract.xml, make.symmetric

Examples

## Not run: 
library(XML)
run = "example1"
filename = "C:/nm73g64/examples/example1.xml"
top = xmlRoot(xmlTreeParse(filename))# names(top)
TMP = top[["nonmem"]][["problem"]]
TMP = TMP[grepl("estimation", names(TMP))]
len = length(TMP)
## get estimation titles
est.methods = sapply(1:length(TMP), function(x,TMP)
  xmlValue(TMP[x][["estimation"]][["estimation_title"]]), TMP = TMP)
names(TMP) = est.methods
tmp = TMP[[1]]

xml.Extract.NM.Value(asXMLNode(tmp[["theta"]]), what = "theta")
xml.Extract.NM.Value(asXMLNode(tmp[["thetase"]]), what = "theta")
names(tmp)
omega = lapply(asXMLNode(tmp[["omega"]])$children, xml.Extract.NM.Matrix)

make.symmetric(unlist(omega))

## End(Not run)

qPharmetra/qpToolkit documentation built on May 24, 2023, 8:52 a.m.