plot_transitions: Plot a stages transition graph using the 'visNetwork'...

Description Usage Arguments Value Examples

Description

plot_transitions uses the visNetwork package to plot a stages transition htmlWidget graph showing stages as nodes and probabilities on edges.

Usage

1
plot_transitions(e, height = "500px", width = "100%")

Arguments

e

Events dataframe containing stages. Dataframe must have begin (POSIXt), end (POSIXt) and event (character) columns.

height

height in pct or px.

width

width.

Value

A visNetwork htmlWidget.

Examples

1
2
3
4
e <- data.frame(begin = as.POSIXlt(seq(from = 0, to = 30*10, by = 30),origin = "1970-01-01"))
e$end <- as.POSIXlt(seq(from = 30, to = 30*11, by = 30), origin = "1970-01-01")
e$event = c("AWA","N1","N2","N3","N3","REM","N2","REM","N2","REM","AWA")
plot_transitions(e, height = "500px", width = "500px")

boupetch/rmdf documentation built on June 26, 2019, 2:25 p.m.