Learn R Programming

screenshot (version 0.9.2)

index2xy: Convert array index into xy location in matrix. Helper function for locate_ndl_in_hay().

Description

Convert array index into xy location in matrix. Helper function for locate_ndl_in_hay().

Usage

index2xy(index, nrow)

Value

       A numeric pair of xy location.

Arguments

index, nrow

A numeric.

Examples

Run this code
nrow <- 4
matrix(1:12, nrow = nrow)
purrr::map(1:12, index2xy, nrow = nrow)

Run the code above in your browser using DataLab