extractIndSubset: Extracts a subset of 'x' defined by the index list or vector...

View source: R/extractIndSubset.R

extractIndSubsetR Documentation

Extracts a subset of 'x' defined by the index list or vector 'ind' and/or the logical vector 'subset'.

Description

Extracts a subset of 'x' defined by the index list or vector 'ind' and/or the logical vector 'subset'.

Usage

extractIndSubset(
  x,
  ind = list(),
  subset = NULL,
  drop = TRUE,
  ind.out = FALSE,
  insert.NA = FALSE,
  only.match = FALSE,
  return.all = TRUE,
  pad = c("end", "start")
)

Arguments

x

is the list or array to be extracted from.

ind

is a list of indexes, as typed into the [] of an array, where 0 and NULL denotes all indexes.

subset

is a numeric or logical vector/expression indicating elements or rows to keep. Missing values are taken as false, and subset=0 or subset=NULL indicates no subsetting. Can be given as a list with subsetting indices for each time step.

drop

is TRUE if dimensions of only one level is to be removed from the output.

ind.out

is TRUE if the one dimensinal vector indexes used in the extraction is to be returned.

insert.NA

is TRUE if the discarded data are to be kept as NA.

only.match

is TRUE if only the arrays of length equal to the length of 'subset' are to be subsetted using 'subset'.

return.all

is FALSE to return empty data and indices when 'ind' and 'subset' are enpty.

pad

determines at which end of the dimensions to pad with zeros if the length of 'ind' is shorter than the number of dimensions. Using pad="start" applies 'ind' on the last dimensions.


arnejohannesholmin/TSD documentation built on April 14, 2024, 5:29 a.m.