Learn R Programming

IFC (version 0.1.1)

writeIFC: IFC Files Generic Writer

Description

Writes IFC data to DAF and subsets or merges RIF/CIF Files.

Usage

writeIFC(fileName, ...)

Arguments

fileName

path to file.

...

arguments to pass to ExportToDAF or ExportToXIF.

Value

it invisible returns the path of exported file.

Details

If 'fileName' is a DAF file ExportToDAF will be used to write file whereas if it is a RIF or CIF file writeIFC will use ExportToXIF.

Examples

Run this code
# NOT RUN {
if(requireNamespace("IFCdata", quietly = TRUE)) {
  tmp <- tempdir(check = TRUE)
  ## use a daf file
  file_daf <- system.file("extdata", "example.daf", package = "IFCdata")
  ## create a tagged population named test with 1st object
  pop <- buildPopulation(name = "test", type = "T", obj = 0)
  writeIFC(file_daf, write_to = paste0(tmp, "\\test_write.daf"),
           overwrite = TRUE, pops = list(pop))
  ## use a rif file, but you can also use a cif
  file_rif <- system.file("extdata", "example.rif", package = "IFCdata")
  writeIFC(fileName = file_rif, write_to = paste0(tmp, "\\test_write.rif"), 
           overwrite = TRUE, objects = 0)
} 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.'))
}
# }

Run the code above in your browser using DataLab