| dim {opm} | R Documentation |
Get the dimensions of the measurements of an
OPM object, or get the dimensions of an
OPMS object, or the number of plates stored
in an OPMX object, or the indexes of all
these plates.
## S4 method for signature 'OPM' dim(x) ## S4 method for signature 'OPMS' dim(x) ## S4 method for signature 'WMD' length(x) ## S4 method for signature 'WMDS' length(x) ## S4 method for signature 'WMD' seq(...) ## S4 method for signature 'WMDS' seq(...)
x |
|
... |
|
Note that dim cannot be used to determine the
correspondence of the time points between all plates as
it reports only the time points of the first plate.
Instead the OPMS method of
hours must be used.
seq yields the indexes of all plates contained in
an OPMS object. This is mainly useful for
looping over such objects. See [ for a
loop-construct usage example, and note that
oapply is also available.
For the OPM method of dim, a
two-element numeric vector (number of time points and
number of wells). For the OPMS method, a
numeric vector with (i) the number of contained
OPM objects, and (ii) and (iii) the
dimensions of the first plate. length returns an
integer scalar. This seq method yields an integer
vector (starting with 1 and at least of length 2).
base::dim base::length base::seq
Other getter-functions: aggr_settings,
aggregated, anyDuplicated,
anyNA, contains,
csv_data, disc_settings,
discretized, duplicated,
has_aggr, has_disc,
hours, max,
measurements, minmax,
subset, thin_out,
well
# OPM methods
(x <- dim(vaas_1))
## [1] 384 96
stopifnot(identical(x, c(384L, 96L)))
(x <- length(vaas_1))
## [1] 1
stopifnot(identical(x, 1L)) # 1 plate contained
(x <- try(seq(vaas_1), silent = TRUE)) # deliberately yields an error
## [1] "Error in seq(vaas_1) : one cannot loop over an object of class OPMD\n"
## attr(,"class")
## [1] "try-error"
## attr(,"condition")
## <simpleError in seq(vaas_1): one cannot loop over an object of class OPMD>
stopifnot(inherits(x, "try-error"))
# OPMS methods
(x <- dim(vaas_4)) # 2nd value needs not be correct for all plates
## [1] 4 384 96
stopifnot(identical(x, c(4L, 384L, 96L)))
(x <- length(vaas_4))
## [1] 4
stopifnot(identical(x, 4L)) # 4 plates contained
(x <- seq(vaas_4))
## [1] 1 2 3 4
stopifnot(identical(x, 1:4)) # indexes for 4 plates
(y <- seq(vaas_4, letters, LETTERS)) # other arguments are ignored
## [1] 1 2 3 4
stopifnot(identical(x, y))