
Last chance! 50% off unlimited learning
Sale ends in
Adds populations to an already existing `IFC_data` object.
data_add_pops(
obj,
pops,
pnt_in_poly_algorithm = 1,
pnt_in_poly_epsilon = 1e-12,
display_progress = TRUE,
...
)
an IFC_data object with pops added.
an `IFC_data` object extracted by ExtractFromDAF(extract_features = TRUE) or ExtractFromXIF(extract_features = TRUE).
a list of population(s) to add to 'obj'. Each element of this list will be coerced by buildPopulation
.
algorithm used to determine if object belongs to a polygon region or not. Default is 1.
Note that for the moment only 1(Trigonometry) is available.
epsilon to determine if object belongs to a polygon region or not. It only applies when algorithm is 1. Default is 1e-12.
whether to display a progress bar. Default is TRUE.
Other arguments to be passed.
A warning will be thrown if a provided population is already existing in 'obj'.
In such a case this population will not be added to 'obj'.
If any input population is not well defined and can't be created then an error will occur.
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 population from existing daf
pop <- daf$pops[[1]]
if(length(pop) != 0) {
pop_copy <- pop
## modify name, obj and type of copied population
pop_copy$name <- paste0(pop_copy$name,"_copy")
pop_copy$obj <- (which(pop_copy$obj)-1)[1]
pop_copy$type <- "T"
## create new object with this new population
dafnew <- data_add_pops(obj = daf, pops = list(pop_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