Description Usage Arguments Details Value See Also Examples
Sort an OPMS object based on one to several
metadata or CSV data entries, or sort elements
of a MOPMX object based on plate type,
length, or a metadata entry. Alternatively, remove
duplicated elements from a OPMS or
MOPMX object, or revert the order of plates
within an OPMS object, or, repeat
OPMS or OPM objects zero
times, once, or several times.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | ## S4 method for signature 'OPM'
rep(x, ...)
## S4 method for signature 'OPMS'
rep(x, ...)
## S4 method for signature 'OPM'
rev(x)
## S4 method for signature 'OPMS'
rev(x)
## S4 method for signature 'MOPMX,ANY'
sort(x, decreasing,
by = c("plate.type", "length"), exact = TRUE, strict = TRUE,
na.last = TRUE, ...)
## S4 method for signature 'MOPMX,missing'
sort(x, decreasing, ...)
## S4 method for signature 'OPM,ANY'
sort(x, decreasing, ...)
## S4 method for signature 'OPM,missing'
sort(x, decreasing, ...)
## S4 method for signature 'OPMS,ANY'
sort(x, decreasing, by = "setup_time",
parse = identical(by, "setup_time"), exact = TRUE, strict = TRUE,
na.last = TRUE)
## S4 method for signature 'OPMS,missing'
sort(x, decreasing, ...)
## S4 method for signature 'MOPMX,ANY'
unique(x, incomparables, ...)
## S4 method for signature 'MOPMX,missing'
unique(x, incomparables, ...)
## S4 method for signature 'OPM,ANY'
unique(x, incomparables, ...)
## S4 method for signature 'OPM,missing'
unique(x, incomparables, ...)
## S4 method for signature 'OPMS,ANY'
unique(x, incomparables, ...)
## S4 method for signature 'OPMS,missing'
unique(x, incomparables, ...)
|
x |
|
decreasing |
Logical scalar. Passed to |
by |
List or character vector. For
For |
parse |
Logical scalar. Convert the
|
exact |
Logical scalar. Passed to
|
strict |
Logical scalar. Is it an error if metadata
keys are not found? If |
na.last |
Logical scalar. Also passed to
|
incomparables |
Vector passed to
|
... |
Optional arguments passed between the methods
or to |
The sort OPM method just returns the
input data to avoid destructive effects due to the way
the default sort interacts with OPM
indexing.
rev should be slightly more efficient than calling
the default rev method. There is also an
OPM method which just returns the input
data (to avoid destructive effects due to the way the
default rev interacts with OPM
indexing).
The OPM method of unique also
returns the passed object.
rev yields an OPMS object with
another number of plates, or an OPM object,
or NULL.
OPMS object with not necessarily the same
order of plates than before, or OPM object.
base::order base::sort base::strptime base::unique base::rev
base::rep
Other conversion-functions: as.data.frame,
extract, extract_columns,
flatten, merge,
oapply, opmx,
plates, split,
to_yaml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | ## 'OPMS' methods
# Existing keys
stopifnot(is.unsorted(metadata(vaas_4, "Strain")))
x <- sort(vaas_4, by = list("Strain"))
stopifnot(is(x, "OPMS"), !is.unsorted(metadata(x, "Strain")))
x <- sort(vaas_4, by = list("Strain"), decreasing = TRUE)
stopifnot(is(x, "OPMS"), is.unsorted(metadata(x, "Strain")))
# Non-existing keys
x <- try(sort(vaas_4, by = list("Not there", "Missing"), strict = TRUE))
stopifnot(inherits(x, "try-error")) # yields error
x <- try(sort(vaas_4, by = list("Not there", "Missing"), strict = FALSE))
stopifnot(identical(x, vaas_4)) # no error, but no new order
# CSV-data based
copy <- sort(vaas_4) # default: by setup time
csv_data(vaas_4, what = "setup_time")
csv_data(copy, what = "setup_time")
stopifnot(!identical(copy, vaas_4))
copy <- sort(vaas_4, by = c("Position", "Setup Time"))
csv_data(vaas_4, what = "position")
csv_data(copy, what = "position")
stopifnot(!is.unsorted(csv_data(copy, what = "position")))
stopifnot(is.unsorted(csv_data(vaas_4, what = "position")))
# sorting accoring to overall measurement duration
stopifnot(identical(sort(vaas_4, TRUE, "hours"), vaas_4))
# (uniform measurements durations in this object)
# making OPMS objects unique
dim(x <- unique(vaas_4))
stopifnot(identical(x, vaas_4))
dim(x <- unique(c(vaas_4, vaas_4)))
stopifnot(identical(x, vaas_4))
dim(x <- unique(vaas_4, what = "Species")) # species are not unique
stopifnot(dim(x)[1L] < dim(vaas_4)[1L])
dim(x <- unique(vaas_4, what = list("Species", "Strain")))
stopifnot(identical(x, vaas_4)) # organisms are unique
# reverting an OPMS object
dim(x <- rev(vaas_4))
stopifnot(dim(x) == dim(vaas_4), !identical(x, vaas_4))
stopifnot(identical(rev(x), vaas_4))
# repeating an OPMS object
dim(x <- rep(vaas_4))
stopifnot(identical(x, vaas_4))
dim(x <- rep(vaas_4, times = 2))
stopifnot(length(x) == length(vaas_4) * 2)
dim(y <- rep(vaas_4, each = 2))
stopifnot(length(y) == length(vaas_4) * 2, !identical(x, y))
stopifnot(is.null(rep(vaas_4, 0)))
## 'OPM' methods
summary(x <- sort(vaas_1))
stopifnot(identical(x, vaas_1))
dim(x <- unique(vaas_1)) # trivial
stopifnot(identical(x, vaas_1))
dim(x <- unique(vaas_1, what = list("Species", "Strain")))
stopifnot(identical(x, vaas_1))
dim(x <- rev(vaas_1)) # trivial
stopifnot(identical(x, vaas_1))
dim(x <- rep(vaas_1, 1))
stopifnot(identical(x, vaas_1))
dim(x <- rep(vaas_1, 2)) # conversion to OPMS if > 1 element
stopifnot(length(x) == 2, is(x, "OPMS"))
stopifnot(is.null(rep(vaas_4, 0)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.