dim: Get dimensions

Description Usage Arguments Details Value See Also Examples

Description

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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  ## 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(...) 

Arguments

x

OPMX object.

...

OPMS objects. Several ones can be provided, but all but the first one are ignored. For reasons of comparability, the OPM method of seq deliberately results in an error.

Details

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.

Value

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).

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# OPM methods
(x <- dim(vaas_1))
stopifnot(identical(x, c(384L, 96L)))
(x <- length(vaas_1))
stopifnot(identical(x, 1L)) # 1 plate contained
(x <- try(seq(vaas_1), silent = TRUE)) # deliberately yields an error
stopifnot(inherits(x, "try-error"))

# OPMS methods
(x <- dim(vaas_4)) # 2nd value needs not be correct for all plates
stopifnot(identical(x, c(4L, 384L, 96L)))
(x <- length(vaas_4))
stopifnot(identical(x, 4L)) # 4 plates contained
(x <- seq(vaas_4))
stopifnot(identical(x, 1:4)) # indexes for 4 plates
(y <- seq(vaas_4, letters, LETTERS)) # other arguments are ignored
stopifnot(identical(x, y))

opm documentation built on May 2, 2019, 6:08 p.m.