setXMLFilePath-methods: The 'setXMLFilePath' function

Description Usage Arguments Value Author(s) References Examples

Description

Specifies the XML file to parse.

Usage

1
setXMLFilePath(this, xmlPath)

Arguments

this

the underlying object of class mtkParsor

xmlPath

a string indicating the XML file to parse.

Value

invisble()

Author(s)

Juhui WANG, MIA-Jouy, Inra, Juhui.Wang@jouy.inra.fr

References

J. Wang, H. Richard, R. Faivre, H. Monod (2013). Le package mtk, une bibliothèque R pour l'exploration numérique des modèles. In: Analyse de sensibilité et exploration de modèles : Application aux sciences de la nature et de l'environnement (R. Faivre, B. Iooss, S. Mahévas, D. Makowski, H. Monod, Eds). Editions Quae, Versailles.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Specify the XML file's name
	xmlFile <- "WWDM_morris.xml"

## Find where the example XML file is held in the 'mtk' package. 
## (This line is nit useful for real life example!)
	xmlFile <- paste(path.package("mtk", quiet = TRUE),
		"/extdata/",xmlFile,sep = "") 

# Create a XML parsor.		
	parsor <- mtkParsor(xmlFile)

# Create an empty workflow.
	workflow <- mtkExpWorkflow()

# Parse the XML file and initialize the workflow 
# with the data extracted from the XML file.
	run(parsor, workflow) 

# Run the workflow
	run(workflow)
	
# If you want to parse another XML file with the same parsor,
# just changes the XML file to "inst/extdata/ishigami_fast.xml".

	xmlFile <- "ishigami_fast.xml"

# Find where the example XML file is held in the 'mtk' package. 
# (This line is nit useful for real life example!)
	xmlFile <- paste(path.package("mtk", quiet = TRUE),
		"/extdata/",xmlFile,sep = "") 

# Change the XML file to the new one 
	setXMLFilePath(parsor, xmlFile)

# Parse the new XML file and initialize the workflow
# with the data extracted from the XML file.
	run(parsor, workflow) 

# Run the workflow
	run(workflow)

mtk documentation built on May 2, 2019, 4:15 a.m.