transMat: Transition counts

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Create counts in the form of a matrix from one state to the next state.

Usage

1
transMat(State_rec, prob = FALSE, States = NULL)

Arguments

State_rec

This is a list of the currents states can be in numeric, character or factor form

prob

This is a item that when set to true return ths probabilities instead of the counts in each cell

States

This is a item that when given is the list of states that you would like to use, Otherwise defaults to unique(State_rec)

Details

for plotting see transBub

Value

Returns an n by n matrix, with n being the number of states. If states is not supplied, defaults to the number of unique values in State_rec. If prob is true, then these counts are transformed into probabilities, with the sum of each column equalling 1. The counts in each cell are based on the number of times a transistion from the state represented by the column to the state represented by the row occured. See transBub for plotting

Author(s)

Connor F. White

See Also

transBub

Examples

1
2
3
4
5
#make 100 values of blue green and yellow

dat<-sample(c("A","B","C"),100,replace=TRUE)
transMat(dat)
transMat(dat,prob=TRUE)

ConnorFWhite/AssFunc documentation built on May 20, 2019, 4:07 p.m.