duplicated {opm} | R Documentation |
Check whether some, or duplicated, OPM
objects are contained within an OPMS
object, or whether OPMX
objects are
contained within an MOPMX
object. For
reasons of consistency, the OPM
methods
always returns FALSE
or 0
. Alternatively,
query OPMX
objects with other such objects.
## S4 method for signature 'MOPMX,ANY' anyDuplicated(x, incomparables, ...) ## S4 method for signature 'MOPMX,missing' anyDuplicated(x, incomparables, ...) ## S4 method for signature 'OPM,ANY' anyDuplicated(x, incomparables, ...) ## S4 method for signature 'OPM,missing' anyDuplicated(x, incomparables, ...) ## S4 method for signature 'OPMS,ANY' anyDuplicated(x, incomparables, ...) ## S4 method for signature 'OPMS,missing' anyDuplicated(x, incomparables, ...) ## S4 method for signature 'MOPMX,MOPMX' contains(object, other, ...) ## S4 method for signature 'MOPMX,OPMX' contains(object, other, ...) ## S4 method for signature 'OPM,OPM' contains(object, other, ...) ## S4 method for signature 'OPM,OPMS' contains(object, other, ...) ## S4 method for signature 'OPMS,OPM' contains(object, other, ...) ## S4 method for signature 'OPMS,OPMS' contains(object, other, ...) ## S4 method for signature 'OPMX,MOPMX' contains(object, other, ...) ## S4 method for signature 'MOPMX,ANY' duplicated(x, incomparables, what = c("all", "plate.type", "metadata"), exact = TRUE, strict = FALSE, ...) ## S4 method for signature 'MOPMX,missing' duplicated(x, incomparables, ...) ## S4 method for signature 'OPM,ANY' duplicated(x, incomparables, ...) ## S4 method for signature 'OPM,missing' duplicated(x, incomparables, ...) ## S4 method for signature 'OPMS,ANY' duplicated(x, incomparables, what = c("all", "csv", "metadata"), exact = TRUE, strict = FALSE, ...) ## S4 method for signature 'OPMS,missing' duplicated(x, incomparables, ...)
x |
|
incomparables |
Vector passed to |
what |
Indicating which parts of
If |
exact |
Logical scalar passed to
|
strict |
Logical scalar passed to
|
... |
Optional arguments passed to |
object |
|
other |
For the |
The OPMS
and OPM
methods of
contains
test, for instance, whether an
OPM
object is contained in an
OPMS
object. The length of the resulting
logical vector is the length of other
.
Logical vector in the case of duplicated
, integer
scalar in the case of anyDuplicated
. 0
if
no values are duplicated, the index of the first or last
(depending on fromLast
) duplicated object
otherwise. contains
returns a logical vector.
base::duplicated base::anyDuplicated base::identical
Other getter-functions: aggr_settings
,
aggregated
, anyNA
,
csv_data
, dim
,
disc_settings
, discretized
,
has_aggr
, has_disc
,
hours
, max
,
measurements
, minmax
,
seq
, subset
,
thin_out
, well
# 'OPM' methods (x <- duplicated(vaas_1)) # 1 element => nothing duplicated stopifnot(identical(x, FALSE)) (x <- anyDuplicated(vaas_1)) stopifnot(identical(x, 0L)) # no complete plate duplicated (x <- anyDuplicated(vaas_1, what = list("Strain", "Species"))) stopifnot(identical(x, 0L)) # no organisms duplicated # 'OPMS' methods stopifnot(!duplicated(vaas_4)) # => no complete plates duplicated stopifnot(!duplicated(vaas_4, what = list("Species", "Strain"))) # => no organisms duplicated stopifnot(duplicated(vaas_4, what = "Species") == rep(c(FALSE, TRUE), 2)) # => species duplicated x <- vaas_4[c(1, 1)] # => complete plate duplicated stopifnot(c(FALSE, TRUE) == duplicated(x)) stopifnot(identical(anyDuplicated(vaas_4), 0L)) stopifnot(identical(anyDuplicated(vaas_4, what = list("Strain")), 0L)) # => no strains duplicated stopifnot(identical(anyDuplicated(vaas_4, what = list("Species")), 2L)) # => species duplicated x <- vaas_4[c(1, 1)] # complete plate duplicated stopifnot(identical(anyDuplicated(x), 2L)) ## contains: 'OPMS'/'OPM' methods (x <- contains(vaas_4, vaas_4[3])) # single one contained stopifnot(length(x) == 1, x) (x <- contains(vaas_4, vaas_4)) stopifnot(length(x) == 4, x) # all contained (x <- contains(vaas_4[3], vaas_4)) # one of four contained stopifnot(length(x) == 4, sum(x) == 1) stopifnot(contains(vaas_4[3], vaas_4[3])) # identical OPM objects stopifnot(!contains(vaas_4[3], vaas_4[2])) # non-identical OPM objects