# NOT RUN {
if(requireNamespace("IFCdata", quietly = TRUE)) {
## use a daf file
file_daf <- system.file("extdata", "example.daf", package = "IFCdata")
daf <- ExtractFromDAF(fileName = file_daf)
## copy 1st region found in daf
reg <- daf$regions[[1]]
if(length(reg) != 0) {
reg_copy <- reg
## modify region label and x boundaries
reg_copy$label <- paste0(reg_copy$label,"_copy")
reg_copy$x <- reg_copy$x*0.9
## create new object with this new region
dafnew <- data_add_regions(obj = daf, regions = list(reg_copy))
}
} 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