# 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