# NOT RUN {
if(requireNamespace("IFCdata", quietly = TRUE)) {
tmp <- tempdir(check = TRUE)
## use a daf file
file_daf <- system.file("extdata", "example.daf", package = "IFCdata")
daf <- ExtractFromDAF(fileName = file_daf, extract_images = FALSE,
extract_offsets = FALSE, display_progress = FALSE)
L = length(daf$graphs)
if(L > 0) {
## randomly export at most 5 graphs from daf
sel = sample(1:L, min(5, L))
ExportToReport(obj = daf, selection = sel,
write_to = paste0(tmp, "\\test.pdf"), overwrite = TRUE)
}
} 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