Learn R Programming

clickableImageMap (version 1.0)

decode: decode

Description

map the screen coordinates to a cell of a matrix

Usage

decode(y, cal, rcnames)

Value

returns an integer vector of the index of a cell in a matrix or returns -1 if rcnames is TRUE and vector y is not within valid range

Arguments

y

parsed return value of grid.locator()

cal

return value of calibrate()

rcnames

Boolean if TRUE matrix has row names and col names

Examples

Run this code
if(interactive()){
load("data/x_y.RData")
load("data/x_rcnames.RData")
load("data/x_cal2.RData")
decode(x_y,x_cal2,x_rcnames)
}

Run the code above in your browser using DataLab