extract-method: Extract Slots of an S4 Class

Description Usage Arguments Examples

Description

Operators acting on existing classes to extract slot's values.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## S4 method for signature 'RS,character,missing,missing'
x[i, j, drop]

## S4 method for signature 'SM.dlm,character,missing,missing'
x[i, j, drop]

## S4 method for signature 'SM.dlm.fitted,character,missing,missing'
x[i, j, drop]

## S4 method for signature 'SM.HL,character,missing,missing'
x[i, j, drop]

## S4 method for signature 'SM.rnn,character,missing,missing'
x[i, j, drop]

Arguments

x

An S4 object from which to extact slot's values.

i

A character value indicating the slot's name.

j

Missing value which is not used for objects from this package.

drop

Same as j.

Examples

1
2
3
4
5
6
7
n <- 50
# An example to create the RS class.
my_first_class <- RS(sigb = rnorm(n, mean = 0, sd = 1),
                     epsb = rnorm(n, mean = 0, sd = 2),
                     epsp = rnorm(n, mean = 1, sd = 1))
# Extract the slot "sigb"
sigb <- my_first_class["sigb"]

4301350/sm4sd documentation built on June 14, 2020, 4:22 p.m.