This is a special version for objects (in particular data frames or matrices) with the 'keepattr' class, that will keep attributes on extraction. If the object x is a variational matrix or FIM, they will be kept only if the result is still a valid variational matrix or FIM, respectively.

# S3 method for keepattr
[(x, ...)

Arguments

x

object from which to extract element(s) or in which to replace element(s).

...

other arguments passed to a parent generic. Typically used to specify a subset.

Value

The specified subset of x. If x is a variational matrix or FIM, and the result of subsetting is not a valid variational matrix or FIM, then the attributes will be lost. This can happen for example when the FIM is no longer a square matrix. They will also be lost if the class changes. This can happen for example when a single element is extracted.

Author

Martijn van Noort