selectPosition: Select a position in the heatmap

View source: R/interactive.R

selectPositionR Documentation

Select a position in the heatmap

Description

Select a position in the heatmap

Usage

selectPosition(ht_list = get_last_ht(), pos = NULL, mark = TRUE, verbose = TRUE,
    ht_pos = NULL, calibrate = TRUE)

Arguments

ht_list

A HeatmapList-class object returned by draw,Heatmap-method or draw,HeatmapList-method. If it is omitted, it uses the last generated heatmap.

mark

Whether to mark the selected position as a point.

pos

If the value is NULL, it can be selected by click on the heatmap (of cource, the heatmap should be on the interactive graphics device). If it is set, it must be a unit object with length two which corresponds to the x and y position of the point.

verbose

Whether to print messages.

ht_pos

A value returned by htPositionsOnDevice.

calibrate

Internally used. Mainly works for Rstudio desktop IDE.

Details

The regions can be selected interactively or selected manually by setting pos.

Value

A DataFrame object with row indices and column indices corresponding to the selected position.

Examples

if(dev.interactive()) {
    m = matrix(rnorm(100), 10)
    rownames(m) = 1:10
    colnames(m) = 1:10

    ht = Heatmap(m)
    ht = draw(ht)
    selectPosition(ht)
}

jokergoo/InteractiveComplexHeatmap documentation built on Feb. 28, 2024, 7:34 p.m.