faceted.line.plot: Plots a line and scatter plot faceted by sequence and cluster...

Description Usage Arguments Value

View source: R/plot.helpers.R

Description

Plots a line and scatter plot faceted by sequence and cluster with a few visual aids. If it's a permutation, maybe provide the actual clusters so that the theming can work properly. sort the input by outcome to make it faster.

Usage

1
2
3
4
5
6
7
8
faceted.line.plot(
  data.dt,
  sequence.dt,
  cluster.dt,
  actual.cluster.dt = NULL,
  min.time = 0,
  max.time = NULL
)

Arguments

data.dt

data.table with columns participant, cluster, time, and outcome. Outcome should be continuous.

sequence.dt

data.table with information about the sequences, with columns sequence, transition.time, and intervention.time.

cluster.dt

data.table with the correspondence between cluster and sequence, with columns cluster and sequence.

actual.cluster.dt

This function is partly designed to visualise permutation statistics, if cluster.dt is permuted, then you might provide a similar data.table with the actual correpsondence between cluster and sequence so that the graph can be themed as such (i.e. data colours matching original sequence).

min.time

Numeric minimum time on x axis (Default: 0)

max.time

Numeric maximum time on x axis, will try to automatically generate from sequence.dt if NULL (Default: NULL)

Value

A ggplot with data faceted by sequence and cluster.


mattmoo/SteppedWedgeAnalysis documentation built on Jan. 14, 2020, 12:25 a.m.