[<- {opm}R Documentation

Assign subset

Description

Assign subsets of OPMS objects.

Usage

  ## S4 replacement method for signature 'MOPMX,ANY'
x$name <- value

  ## S4 replacement method for signature 'MOPMX,ANY,missing,ANY'
x[i, ...] <- value
  ## S4 replacement method for signature 'MOPMX,ANY,missing,OPMX'
x[i, ...] <- value
  ## S4 replacement method for signature 'OPMS,ANY,missing,NULL'
x[i, j] <- value
  ## S4 replacement method for signature 'OPMS,ANY,missing,OPM'
x[i, j] <- value
  ## S4 replacement method for signature 'OPMS,ANY,missing,OPMS'
x[i, j] <- value
  ## S4 replacement method for signature 'OPMS,ANY,missing,list'
x[i, j] <- value

  ## S4 replacement method for signature 'MOPMX,ANY,missing,ANY'
x[[i, ...]] <- value

Arguments

x

OPMS or MOPMX object.

i

One to several plate indexes. Should be compatible with the length of value. Otherwise any resulting NULL elements will be removed (with a warning), causing the resulting plate indexes to be unequal to i, which might be confusing.

j

Must not be set. See the examples.

...

Must neither be used.

name

Unevaluated symbol used for as index of a single element.

value

Value to be assigned. NULL causes the selected plates to be removed. Alternatively, OPM or OPMS objects or lists of OPM objects can be assigned. All assignments are subject to the restrictions explained in the help entries of the OPMS and MOPMX classes.

Value

value.

See Also

Other combination-functions: c, opms, plus

Examples

copy <- vaas_4
copy[5] <- NULL # has no effect
stopifnot(identical(vaas_4, copy))
length(copy)
## [1] 4
copy[2:3] <- NULL # removes these plates
length(copy)
## [1] 2
stopifnot(length(vaas_4) == length(copy) + 2)
copy[1:4] <- vaas_4 # set all plates to the plates from 'vaas_4'
stopifnot(identical(vaas_4, copy))
copy[3] <- copy[3] # no change
stopifnot(identical(vaas_4, copy))
copy[3] <- copy[2] # now assign other plate
stopifnot(!identical(vaas_4, copy))
copy[6] <- copy[1] # gaps will be closed
## Warning: closing gaps in indexes
stopifnot(length(copy) == 5) # not 6

[Package opm version 1.3.63 Index]