addStateMatrix: addStateMatrix

Description Usage Arguments Value Examples

Description

Adds a new state to a transitions functions matrix.

Usage

1
2
3
addStateMatrix(newMatrix, oldMatrix,
               stateName=paste("state", after+1, sep=" "),
               after=dim(oldMatrix)[1], newCell="NULL")

Arguments

newMatrix

an empty matrix with one more row and one more column than the old

oldMatrix

a matrix to which we are adding a new state;

stateName

the name of the state to be added;

after

the number of the state after which a new state should be added

newCell

the value in the state to be added;

Value

newMatrix a matrix created by adding a new state with the value newCell to the old matrix

Examples

1
2
3
4
5
M <- generateHazardMatrix(5)
largeM <- generateHazardMatrix(6)
oldM <- M@list.matrix
newM <- largeM@list.matrix
M_addedState <- addStateMatrix(newM, oldM, stateName ="newState", after =3, newCell=0)

GUIgems documentation built on May 1, 2019, 8:19 p.m.