Operators acting on objects to extract or replace parts.
methods
## S4 method for signature 'CompositionMatrix,missing,missing,missing'x[i, j,..., drop =TRUE]## S4 method for signature 'CompositionMatrix,missing,missing,logical'x[i, j,..., drop =TRUE]## S4 method for signature 'CompositionMatrix,index,missing,missing'x[i, j,..., drop =TRUE]## S4 method for signature 'CompositionMatrix,index,missing,logical'x[i, j,..., drop =TRUE]## S4 method for signature 'CompositionMatrix,missing,index,missing'x[i, j,..., drop =TRUE]## S4 method for signature 'CompositionMatrix,missing,index,logical'x[i, j,..., drop =TRUE]## S4 method for signature 'CompositionMatrix,index,index,missing'x[i, j,..., drop =TRUE]## S4 method for signature 'CompositionMatrix,index,index,logical'x[i, j,..., drop =TRUE]## S4 replacement method for signature 'CompositionMatrix'x[i, j,...]<- value
## S4 replacement method for signature 'CompositionMatrix'x[[i, j,...]]<- value
Arguments
x: An object from which to extract element(s) or in which to replace element(s).
i, j: Indices specifying elements to extract or replace. Indices are numeric, integer or character vectors or empty (missing) or NULL. Numeric values are coerced to integer as by as.integer(). Character vectors will be matched to the name of the elements. An empty index (a comma separated blank) indicates that all entries in that dimension are selected.
...: Currently not used.
drop: A logical scalar: should the result be coerced to the lowest possible dimension? This only works for extracting elements, not for the replacement. Defaults to FALSE.
value: A possible value for the element(s) of x.
Returns
A subsetted object of the same sort as x.
Examples
## Data from Aitchison 1986data("hongite")## Coerce to compositional datacoda <- as_composition(hongite)head(coda)## Subsetcoda[[1,1]]# Get the first valuecoda[1]# Get the first valuecoda[,]# Get all valuescoda[1,]# Get the first row## Subcompositionsubcoda <- coda[,1:3]# Get the first three columnhead(subcoda)