[.feem {albatross} | R Documentation |
Extract or replace parts of FEEM objects
Description
Extract or replace parts of FEEM spectra. Returns FEEM objects unless dimensions should be dropped. When assigning from a FEEM object, requires wavelengths to match and warns if scale factors differ.
Usage
## S3 method for class 'feem'
x[i, j, drop = TRUE]
## S3 replacement method for class 'feem'
x[i, j] <- value
Arguments
x |
A FEEM object. |
i , j |
Row and column indices, respectively. As in usual R subsetting (see Extract), may be integer, logical or character vectors, or missing. |
drop |
Coerce result to the lowest possible dimension (dropping the
|
value |
An array-like object to assign values from. When assigning from FEEM objects, wavelengths are required to match and warnings are issued if scale factors don't match. Use vector subsetting (zero or one argument inside the brackets) to disable the check. |
Value
For [
: If drop
is TRUE
and at least one of the
index arguments chooses only one element along its axis, a named
numeric vector. Otherwise, a FEEM object.
For [<-
: a FEEM object.
See Also
Examples
(z <- feem(matrix(1:40, ncol = 8), 66 + 1:5, 99 + 1:8, 3))
str(z[1:4, 1:2])
str(z[1,, drop = TRUE])
z[2:3, 4:5] <- feem(matrix(1:4, 2), 66 + 2:3, 99 + 4:5, 3)
z