ExportToDAF {IFC} | R Documentation |
DAF File Writer
Description
Writes a new DAF file based on another one and exports new region(s), pop(s), feature(s), graph(s) and / or mask(s).
Usage
ExportToDAF(
fileName,
write_to,
pops = list(),
regions = list(),
features = list(),
graphs = list(),
masks = list(),
viewing_pop = "All",
endianness = .Platform$endian,
verbose = FALSE,
overwrite = FALSE,
fullname = TRUE,
cifdir = dirname(fileName),
ntry = +Inf,
...
)
Arguments
fileName |
path of file to read data from. |
write_to |
pattern used to export file.
Placeholders, like "%d/%s_fromR.%e", will be substituted: |
pops |
list of population(s) to export. Will be coerced to exportable format by buildPopulation. |
regions |
list of region(s) to export. Will be coerced to exportable format by buildRegion. |
features |
list of feature(s) to export. |
graphs |
list of graph(s) to export. Not yet implemented. |
masks |
list of mask(s) to export. Not yet implemented. |
viewing_pop |
Character String. Allow user to change displayed population. Default is 'All'. |
endianness |
The endian-ness ("big" or "little") of the target system for the file. Default is .Platform$endian. |
verbose |
whether to display information (use for debugging purpose). Default is FALSE. |
overwrite |
whether to overwrite file or not. Default is FALSE.
Note that if TRUE, it will overwrite exported file if path of 'fileName' and deduced from 'write_to' arguments are different.
Otherwise, you will get an error saying that overwriting source file is not allowed. |
fullname |
whether to export daf file with full name of its corresponding cif, if found. Default is TRUE. If cif can't be found, daf file will be exported with the original cif file name. |
cifdir |
the path of the directory to initially look to cif file. Default is dirname(fileName). Only apply when 'fullname' is set to TRUE. |
ntry |
number of times |
... |
other arguments to be passed. |
Value
It invisibly returns full path of exported file.
Examples
if(requireNamespace("IFCdata", quietly = TRUE)) {
## use a daf file
file_daf <- system.file("extdata", "example.daf", package = "IFCdata")
tmp <- tempdir(check = TRUE)
## create a tagged population named test with 1st object
pop <- buildPopulation(name = "test", type = "T", obj = 0)
ExportToDAF(file_daf, write_to = paste0(tmp, "\\test.daf"),
overwrite = TRUE, pops = list(pop))
} else {
message(sprintf('Please run `install.packages("IFCdata", repos = "%s", type = "source")` %s',
'https://gitdemont.github.io/IFCdata/',
'to install extra files required to run this example.'))
}