ListPosition2ListCoordinates: Gives the exact position of the kth item in a list

Description Usage Arguments Details Value Author(s) Examples

View source: R/ListPosition2ListCoordinates.R

Description

Gives the exact position of the kth item in a list comprised of vectors.

Usage

1

Arguments

Position

The kth value for which the position is desired.

ListDimensions

The dimensions (vector length) of each part of the list in order.

Details

The R language has a great variety of ways that data can be stored, but sometimes it can be hard to isolate the required information. For example, imagine you store data in a list composed of vectors of length 1, 3, 2, 6, 1, and 3, but you just want to know where you will find the 13th value. This function will give "coordinates" for that value corresponding to the list number (5 in the example) and vector position in that list (1 in the example).

Value

The position, in terms of both list number ($ListNumber) and list position ($ListPosition), of the kth value.

Author(s)

Graeme T. Lloyd graemetlloyd@gmail.com

Examples

1
2
# Find the position of the 13th value:.
ListPosition2ListCoordinates(13, c(1, 3, 2, 6, 1, 3))

graemetlloyd/metatree documentation built on April 29, 2021, 2:32 a.m.