level.mkv: Levelplot of a first order transition matrix

Description Usage Arguments Details Value Author(s) Examples

View source: R/level.mkv.R

Description

Plot the probabilities of the first orden transition matrix for an mkv object.

Usage

1
2
  level.mkv(m,col=c("gray","red"),xlab="Final Period",ylab="Initial Period",title=NULL,
            cell.size=8,axis.size=16,tick.size=14,...)

Arguments

m

a matrix of n x n or a mkv object.

col

a color vector containing two colours specified as c("low"","high""). By Default the low color is "gray" and the high color is "red"

xlab

a character object conataining the X acis label

ylab

a character object conataining the Y acis label

title

a character object conataining the plot title. By default title=NULL

cell.size

an interfer inidcating the cell text size

axis.size

an interfer inidcating the axis title font size

tick.size

an interfer inidcating the axis ticks font size

...

Other arguments for ggplot(),theme() and geom_text() functions.

Details

A level plot based in a ggplot() graph. The level plot show the probabilities of transition form state i to the state j in gradual color from "low" color to "high" color, also show the probability of the transition in the (i,j) cell. If the matrix or the mkv are transitions, the matrix is transformed into a probabilities transition matrix by dividing the row by the row sum. Different ggplot theme can be creating by setting up a new theme() object.

Value

A level plot of showing the probabilities of transitions between the differents classes.

Author(s)

Andres Vallone

Examples

1
2
3
4
set.seed(100)
z<-matrix(sample(c(1:2500),625,replace=TRUE),25,25)
m<-mkv(z,prob=FALSE)
level.mkv(m)

amvallone/spDym documentation built on May 30, 2019, 8:01 a.m.