tx_transmat: Generate a graphical transition matrix.

Description Usage Arguments Value Examples

View source: R/tx_transmat.r

Description

To show the rates at which one sequence passes to the next within a treatment regime. The method uses the corrplot package to

Usage

1
tx_transmat(txvis, sequences = c(1, 2), nseq = NULL, ...)

Arguments

txvis

An object of class txvis.

sequences

A vector of length two indicating the sequences for which the corrplot will be drawn.

nseq

What is the maximum number of sequences

...

additional arguments to corrplot

Value

A square matrix.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Create the txvis object:

hlth_data <- create_txvis(patient   = treat$pat_id, 
                          treatment = treat$treatment,
                          start     = treat$start,
                          end       = treat$end,
                          date_format = "%d%B%Y")

# A simple correlation plot:
tx_transmat(hlth_data, sequences = c(1, 2))

# Some cutomization:
tx_transmat(hlth_data, 
            sequences = c(1, 2), 
            mar = c(2, 2, 2, 2),
            order = "hclust")

johnwilsonICON/TxVis documentation built on May 19, 2019, 5:18 p.m.