subsetOffsets {IFC}R Documentation

IFC_offset Subsetting

Description

Subsets 'IFC_offset'

Usage

subsetOffsets(offsets, objects, image_type = c("img", "msk"))

Arguments

offsets

object of class 'IFC_offset' to subset.

objects

integer vector, IDEAS objects ids numbers to extract.

image_type

image_type of desired offsets. Default is c("img", "msk"). Allowed are "img" and/or "msk".

Value

a class 'IFC_offset' integer vector or empty integer() if objects are outside of offsets.

Examples

if(requireNamespace("IFCdata", quietly = TRUE)) {
  ## use a cif file
  file_cif <- system.file("extdata", "example.cif", package = "IFCdata")
  ## extract offsets
  offsets <- getOffsets(fileName = file_cif)
  ## subset offsets of the 4 first "img" objects
  sub_offs <- subsetOffsets(offsets = offsets, objects = 0:3, image_type = "img")
  ## show subsetted offsets' structure
  str(sub_offs)
} 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.'))
}

[Package IFC version 0.2.1 Index]