opms {opm} | R Documentation |
Easily build OPMS
(or MOPMX
)
objects.
opms(..., precomputed = TRUE, skip = FALSE, group = FALSE)
... |
One to several objects which are either
potentially nested lists of |
precomputed |
Logical scalar. If |
skip |
Logical scalar. If |
group |
Logical or character scalar. If |
While otherwise rather flexible, this function will fail
to return an OPMS
object if group
is
set to FALSE
and the plate types do not match
(simply because such OPMS
objects are
disallowed). But if group
is set to TRUE
, a
list (MOPMX
object), not a single
OPMS
object will be returned; and if
group
is of mode ‘character’, this extracts
the plate type(s) of interest.
Note that read_opm
already has plate-type
selection options.
OPMS
object, or list (MOPMX
object) of such objects (and/or OPM
objects), or OPM
object, or NULL
.
Other combination-functions: $<-
,
[<-
, [[<-
, c
,
plus
## Testing distinct OPM/OPMS combinations -- all should work.
## Note the number of contained plates in the generated objects.
(x <- opms()) # 0 objects
## NULL
stopifnot(is.null(x))
(x <- opms(group = TRUE)) # 0 also objects
## [1] Length Plate.type Aggregated Discretized
## <0 rows> (or 0-length row.names)
##
## => MOPMX object with 0 element(s), details are shown above.
## Access the elements with [[ or $ to apply specific methods.
stopifnot(is(x, "MOPMX"), length(x) == 0)
dim(x <- opms(vaas_1)) # 1 object
## [1] 384 96
stopifnot(identical(x, vaas_1))
dim(x <- opms(vaas_4, group = plate_type(vaas_4)))
## [1] 4 384 96
stopifnot(identical(x, vaas_4))
dim(x <- opms(vaas_4, group = "PM01"))
## NULL
stopifnot(is.null(x)) # no such plate type => empty object!
dim(x <- opms(vaas_1, vaas_1)) # 2 objects
## [1] 2 384 96
stopifnot(is(x, "OPMS"), length(x) == 2L)
dim(x <- opms(vaas_4, vaas_1))
## [1] 5 384 96
stopifnot(is(x, "OPMS"), length(x) == 5L)
dim(x <- opms(vaas_1, vaas_4))
## [1] 5 384 96
stopifnot(is(x, "OPMS"), length(x) == 5L)
dim(x <- opms(vaas_4, vaas_4))
## [1] 8 384 96
stopifnot(is(x, "OPMS"), length(x) == 8L)