icurve: icurve

Description Usage Arguments See Also Examples

View source: R/iplots.R

Description

Interactive curves over time with optional interactive scatter plots.

Each timepoint is a column of mat, that is, times are treated as discrete and assumed to be uniformly-spaced. Observations will be linked across all plots (curves and optional scatter plots) by row index, so observations should be in the same order in all data provided.

Usage

1
2
3
4
5
6
7
8
9
icurve(
  mat,
  labels,
  group,
  iscatter1 = NULL,
  iscatter2 = NULL,
  plotOpts = NULL,
  digits = NULL
)

Arguments

mat

a numeric matrix, observations x timepoints

labels

optional character vector or named list of character vectors to label each point; if NULL, points will be labeled by index

group

vector of group (factor-like) variables

iscatter1

a numeric matrix or NULL, nobs x 2

iscatter2

see iscatter1

plotOpts

list of additional plot options; see icurveOpts

digits

integer indicating number of significant digits to use

See Also

iplotCurves from the qtlcharts package

saveWidget

Other iplots: icorr(), idot(), iscatter(), itree()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## basic usage, no scatter plots
icurve(matrix(AirPassengers, ncol = 12, byrow = TRUE), labels = 1949:1960)

## connecting observations over time with additional linked scatter plots
set.seed(1)
n <- 25
## 25 observations and 5 timepoints
mm <- cbind(runif(n, 0, 10), runif(n, 10, 50), runif(n, 30, 60),
            runif(n, 40, 80), runif(n, 60, 100))
mm <- mm[order(mm[, 5]), ]

## two sets of data (25 obs x 2 columns: id and numeric data)
x1 <- cbind(1:n, kinda_sort(rnorm(n), n / 2))
x2 <- cbind(1:n, kinda_sort(sample(1:100, n), n / 2))

icurve(
  mat = mm, group = 1:25 %% 5 == 0,
  iscatter1 = x1, iscatter2 = x2,
  labels = list(
    Patient = 1:25,
    Disease = sample(c('ALL','CLL'), 25, replace = TRUE)
  ),
  plotOpts = list(
    curves_xlab = 'Response evaluation time point',
    curves_ylab = '% response',
    scat1_xlab = 'Patient', scat1_ylab = 'Lab var 1',
    scat2_xlab = 'Patient', scat2_ylab = 'Lab var 2'
  )
)

raredd/iplotr documentation built on March 19, 2021, 12:45 a.m.