rn_transition: Create transition network

View source: R/rn.R

rn_transitionR Documentation

Create transition network

Description

Create transition network

Usage

rn_transition(
  phaseSequence,
  threshold = NA,
  doMatrixPlot = TRUE,
  doNetworkPlot = TRUE,
  excludeOther = FALSE,
  excludeNorec = TRUE,
  returnGraph = FALSE
)

Arguments

phaseSequence

A vector with names or numbers that represent a sequence of phases or order parameter dynamics. If a named numeric vector is passed, the names attribute will be used to represent the phases. If the variable phase_name, generated by rn_phases is used, the arguments excludeOther and excludeNorec wil be evaluated.

threshold

Provide a threshold for the relative frequencies. Values below the threshold will be set to 0. Pass NA to not use a threshold (default = NA)

doMatrixPlot

default(TRUE)

doNetworkPlot

default(TRUE)

excludeOther

Should the phase "Other" be excluded from plots? (default = FALSE)

excludeNorec

Should the category "No recurrence" be excluded from plots? (default = TRUE)

returnGraph

Return an igraph::igraph() object (default = FALSE)

Value

A transition matrix based on relative frequencies

Author(s)

Fred Hasselman

Matti Heino

Examples


# This will output the transition matrix, a plot of the matrix and a transition network plot.
y <- c("Happy", "Happy", "Sad", "Neutral", "Neutral", "Angry", "Sad", "Sad", "Neutral")
TM <- rn_transition(y)


FredHasselman/casnet documentation built on April 20, 2024, 3:05 p.m.