idot: idot

Description Usage Arguments See Also Examples

View source: R/iplots.R

Description

Interactive dot plot.

Any numeric data can be plotted on the y-axis but the x-axis should be discrete groups. Points will be labeled with the vector names, the labels parameter, or by index otherwise.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
idot(
  x,
  y = NULL,
  group = NULL,
  cex = 5,
  xlim = NULL,
  ylim = NULL,
  xlab = NULL,
  ylab = NULL,
  main = NULL,
  names = NULL,
  labels = NULL,
  plotOpts = NULL,
  digits = NULL
)

Arguments

x

a numeric vector of y values (if y is NULL) or if y is given, a vector of x values; if x is an named vector, these labels will be passed on to labels

y

optional numeric vector of y values; if missing, x is used

group

optional vector of categories for coloring points

cex

point size in pixels

xlim, ylim

x- and y-limits

xlab, ylab, main

the x-, y-, and main labels

names

labels under each group of dots

labels

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

plotOpts

list of additional plot options; see idotOpts

digits

integer indicating number of significant digits to use

See Also

iplotPXG from the qtlcharts package

saveWidget

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## basic usage with named vectors
idot(setNames(mtcars$mpg, rownames(mtcars)))

## using group and subgroup (a vector of logicals to color points)
with(mtcars, {
  idot(gear, mpg, group = am + 1L, cex = 5, ylim = c(0, 40),
       labels = rownames(mtcars))
})

## labels parameter supports additional formatting with html tags
with(ivolcano, {
  idot(substr(rownames(ivolcano), 1, 1), logFC,
       group = cut(pval, c(0, 0.05, .1, 1)), xlab = 'Treatment arm',
       labels = list(
         ' ' = rownames(ivolcano),
         'log2(FC)' = round(logFC, 2),
         '<em>p</em>-value' =
           format.pval(ivolcano$pval, digits = 2, eps = .05)))
})

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