subset {nexus} | R Documentation |
Extract or Replace Parts of an Object
Description
Operators acting on objects to extract or replace parts.
Usage
## 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 method for signature 'OutlierIndex,index,ANY'
x[[i]]
## 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
|
... |
Currently not used. |
drop |
A |
value |
A possible value for the element(s) of |
Value
A subsetted object of the same sort as x
.
Author(s)
N. Frerebeau
See Also
Other mutators:
groups
,
identifiers
,
samples
,
split()
,
totals
Examples
## Data from Aitchison 1986
data("hongite")
## Coerce to compositional data
coda <- as_composition(hongite)
head(coda)
## Subset
coda[[1, 1]] # Get the first value
coda[1] # Get the first value
coda[, ] # Get all values
coda[1, , drop = FALSE] # Get the first row
## Subcomposition
subcoda <- coda[, 1:3, drop = FALSE] # Get the first three column
head(subcoda)