saveModule: Save a module to disk

Description Usage Arguments Details Value Examples

Description

Save a module to an XML file on disk. File is saved to the directory named in targetDirectory.

Usage

1
2
saveModule(module, targetDirectory = getwd(), filename = paste0(module$name,
  ".xml"))

Arguments

module

module object

targetDirectory

destination directory

filename

Filename for resulting XML file

Details

The resulting XML file will be called ‘module$name.xml’ unless another filename is specified.

targetDirectory must exist, or function exits with error. If no targetDirectory file is saved to current working directory.

Value

resulting file location

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
targ1 <- tempdir() 

## use a module's name for filename
mod1xml <- system.file("extdata", "simpleGraph", "createGraph.xml", 
		           package = "conduit")
mod1 <- loadModule("createGraph", 
		       ref = mod1xml)
saveModule(module = mod1, targetDirectory = targ1)

## specify a filename for the module XML
mod2xml <- system.file("extdata", "simpleGraph", "layoutGraph.xml",
		           package = "conduit")
mod2 <- loadModule("layoutGraph",
		       ref = mod2xml)
saveModule(module = mod2, targetDirectory = targ1,
	       filename = "myNewModule.xml")

anhinton/conduit documentation built on May 10, 2019, 11:48 a.m.