as.pxml: Convert a Param File to XML

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Convert the contents of a file to XML, encoding the leading lines as a ‘note’ element and the following lines as a table.

Usage

1
as.pxml.ext(file, lead = 1, tag = 'param', ...)

Arguments

file

path to a parameter file

lead

number of leading ‘note’ lines

tag

name for the enclosing element

...

ignored

Details

The ‘note’ and ‘body’ are identified, and coerced using as.xml. The result is nested in an element with the name specified by tag. The first column of ‘body’ is used as the key.

Value

character

Author(s)

Tim Bergsma

References

http://metrumrg.googlecode.com

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
ext <- c(
'TABLE NO.  1: First Order: Goal Function=MINIMUM VALUE OF OBJECTIVE FUNCTION',
' ITERATION    THETA1       THETA2       THETA3       SIGMA(1,1)   OMEGA(1,1)   OBJ',
'            0  1.70000E+00  1.02000E-01  2.90000E+01  0.00000E+00  1.17001E+00  11.57008663984839',
'            2  1.78158E+00  1.06239E-01  3.05314E+01  0.00000E+00  1.08862E+00  9.377909428896904',
'            4  1.91182E+00  1.05179E-01  3.14289E+01  0.00000E+00  8.96680E-01  8.983605357031118',
'            6  1.94836E+00  1.01426E-01  3.20728E+01  0.00000E+00  9.06374E-01  8.940731060922468',
'            8  1.93983E+00  1.01742E-01  3.20128E+01  0.00000E+00  8.99988E-01  8.940110966224346',
'           10  1.94057E+00  1.01681E-01  3.20217E+01  0.00000E+00  8.99322E-01  8.940101673144566',
'           11  1.94057E+00  1.01681E-01  3.20217E+01  0.00000E+00  8.99322E-01  8.940101673144566',
'  -1000000000  1.94057E+00  1.01681E-01  3.20217E+01  0.00000E+00  8.99322E-01  8.940101673144566',
'  -1000000001  6.28499E-01  7.36368E-03  1.25313E+00  0.00000E+00  5.44628E-01  0.'
)
file <- textConnection(ext)
pxml <- as.pxml.ext(file)
close(file)
pxml

anniejw6/metrumrg documentation built on May 10, 2019, 11:50 a.m.