c {opm}R Documentation

Combination and addition of plates

Description

Combine an OPMX or MOPMX object with other objects.

Usage

  ## S4 method for signature 'ANY,MOPMX'
e1 + e2 
  ## S4 method for signature 'MOPMX,ANY'
e1 + e2 
  ## S4 method for signature 'MOPMX,OPMX'
e1 + e2 
  ## S4 method for signature 'MOPMX,numeric'
e1 + e2 
  ## S4 method for signature 'OPM,MOPMX'
e1 + e2 
  ## S4 method for signature 'OPM,OPM'
e1 + e2 
  ## S4 method for signature 'OPM,OPMS'
e1 + e2 
  ## S4 method for signature 'OPM,list'
e1 + e2 
  ## S4 method for signature 'OPM,numeric'
e1 + e2 
  ## S4 method for signature 'OPMS,MOPMX'
e1 + e2 
  ## S4 method for signature 'OPMS,OPM'
e1 + e2 
  ## S4 method for signature 'OPMS,OPMS'
e1 + e2 
  ## S4 method for signature 'OPMS,list'
e1 + e2 
  ## S4 method for signature 'OPMS,numeric'
e1 + e2 
  ## S4 method for signature 'numeric,MOPMX'
e1 + e2 
  ## S4 method for signature 'numeric,OPM'
e1 + e2 
  ## S4 method for signature 'numeric,OPMS'
e1 + e2 

  ## S4 method for signature 'MOPMX'
c(x, ..., recursive = FALSE) 
  ## S4 method for signature 'OPMX'
c(x, ..., recursive = FALSE) 

Arguments

x

OPMX or MOPMX object.

...

Other R objects.

recursive

Logical scalar. See c from the base package.

e1

OPMX object. If e2 is a MOPMX object, anything that can be converted with as to that class.

e2

OPMX object, list or numeric scalar. If e1 is a MOPMX object, anything that can be converted with as to that class. If e2 is a numeric scalar, the time points are modified to yield this as interval (and zero as first time point, irrespective of the previous value). This is only needed in the case of recording artefacts and should be used with caution.

Value

The OPMX method of c creates an OPMS object if possible, otherwise a list, or an OPM object (if ... is not given and x is such an object). Similarly, the MOPMX method of c creates a MOPMX object is possible and a list otherwise.

If successful, + yields an OPMS object that contains the plates from both e1 and e2, but it raises an error if the plates cannot be combined.

See Also

base::c

Other combination-functions: $<-, [<-, [[<-, opms

Examples

# Adding nothing
dim(x <- c(vaas_1))
## [1] 384  96
stopifnot(identical(x, vaas_1))
dim(x <- c(vaas_4))
## [1]   4 384  96
stopifnot(identical(x, vaas_4))

# Not particularly useful: adding identical plates!
dim(x <- c(vaas_1, vaas_1)) # yields a two-plate OPMS object
## [1]   2 384  96
stopifnot(identical(dim(x), c(2L, dim(vaas_1))))

# Also not particularly useful: adding partially identical plates!
dim(x <- c(vaas_4, vaas_1))
## [1]   5 384  96
stopifnot(identical(dim(x), c(5L, dim(vaas_1))))

# The following examples do not show particularly useful additions, as the
# plates are either entirely or partially identical. Note the changes in the
# dimensions.

# OPM+OPM method
dim(x <- vaas_1 + vaas_1)
## [1]   2 384  96
stopifnot(identical(dim(x), c(2L, dim(vaas_1))))

# OPM+OPMS method
dim(x <- vaas_1 + vaas_4)
## [1]   5 384  96
stopifnot(identical(dim(x), c(5L, dim(vaas_1))))

# OPM+list method
dim(x <- vaas_1 + list(vaas_1, vaas_1))
## [1]   3 384  96
stopifnot(identical(dim(x), c(3L, dim(vaas_1))))

# OPMS+OPMS method
dim(x <- vaas_4 + vaas_4)
## [1]   8 384  96
stopifnot(identical(dim(x), c(8L, dim(vaas_4)[-1L])))

# OPMS+OPM method
dim(x <- vaas_4 + vaas_1)
## [1]   5 384  96
stopifnot(identical(dim(x), c(5L, dim(vaas_1))))

# OPMS+list method
dim(x <- vaas_4 + list(vaas_1))
## [1]   5 384  96
stopifnot(identical(dim(x), c(5L, dim(vaas_1))))

[Package opm version 1.3.63 Index]