subsetOffsets: IFC_offset Subsetting

View source: R/subsetOffsets.R

subsetOffsetsR 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.'))
}

IFC documentation built on Sept. 14, 2023, 1:08 a.m.