Learn R Programming

rEMM (version 1.0-5)

update: Update a TRACDS temporal structure with new state assignements

Description

Add a sequence of new state assignments to a TRACDS object.

Usage

## S3 method for class 'TRACDS':
update(object, newdata, verbose=FALSE, ...)
reset(x)

Arguments

x,object
a TRACDS object. Note that this function changes the original object!
newdata
a vector with a state assignemnt sequence (typically produced by clustering).
verbose
logical; verbose output?
...
further arguments.

Value

  • A reference to the changed TRACDS object with the data added. Note: EMM objects store all variable data in an environment which enables us to update partial data without copying the whole object. Assignment will not create a copy! Use the provided method copy().

Details

update() adds a new state assignemnt sequenc to the TRACDS object by increasing the transition counts and, if needed, creating new states.

reset resets the current state to NA for reading in a new sequence. An NA in newdata also resets the current state.

See Also

Class TRACDS, fade.

Examples

Run this code
## create an empty TRACDS object
tracds <- TRACDS()
tracds

## update with an cluster assignment sequence
update(tracds, c(1,2,5,5,2))
tracds

plot(tracds)

Run the code above in your browser using DataLab