idx2dimnames: Index to Dimnames

View source: R/shortestPath.R

idx2dimnamesR Documentation

Index to Dimnames

Description

A function to map from integer offsets in an array to the corresponding values of the row and column names. There is probably a better way but I didn't find it.

Usage

idx2dimnames(x, idx)

Arguments

x

a matrix or data.frame.

idx

An integer vector of offsets into the matrix (values between 1 and the length of the matrix.

Value

A list with two components. If it is a LIST, use

rowNames

The row names corresponding to the integer index.

colNames

The column names corresponding to the integer index.

Author(s)

R. Gentleman

See Also

dimnames

Examples

 data(Ndists)
 ltInf = is.finite(Ndists)
 xx = idx2dimnames(Ndists, ltInf)

Bioconductor/GOstats documentation built on Oct. 29, 2023, 4:17 p.m.